Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am a new learner. I have two tables: login and recharge of same database “registration”.

“login” table has name, address and mobile as a row and “recharge” table has mobile and amount as a row. I want mobile number list of “login” table should display as a drop down select list in mobile row of “recharge table so that i should not retype as text input. Someone please help me out .

What I have tried:

PHP
<?php
 error_reporting('E_ALL ^ E_NOTICE');
 if(isset($_POST['submit']))
 {
  mysql_connect('localhost','root','') or die(mysql_error());
  mysql_select_db('registration') or die(mysql_error());
  
$reg1=$_POST['reg1'];
$date=$_POST['date'];
$mobile=$_POST['mobile'];
$amt=$_POST['amt'];
$pbal=$_POST['pbal'];
$cbal=$_POST['cbal'];

$q=mysql_query("select * from recharge where reg1='".$reg1."'or date='".$date."'  or mobile='".$mobile."'
or amt='".$amt."'or pbal='".$pbal."'or cbal='".$cbal."'") or die(mysql_error());
  

   
$insert=mysql_query("insert into recharge values('".$reg1."','".$date."','".$mobile."','".$amt."','".$pbal."','".$cbal."')") or die(mysql_error());
   
if($insert)
   
{
    $er='Registered successfully';
  
 }
   else
   {

    $er='Not Registered';

   }
  

 }

?>
<div class="contact">

<h1>REGISTRATION FORM</h1>
<div id="er"><?php echo $er; ?></div>
<table width="963" align="center" id="tbl"><tbody><tr><td width="224"> REGISTRATION NUMBER :</td><td width="252"></td><td width="224"> DATE :</td><td>
  
  $(function() {
    $( "#datepicker" ).datepicker();


  });
  
</td></tr><tr><td> MOBILE NUMBER :</td><td></td><td>STOCK RECHARGE AMOUNT : </td><td></td></tr><tr><td> PREVIOUS BALANCE :</td><td></td><td> CURRENT BALANCE : </td><td></td></tr><tr><td></td><td></td></tr></tbody></table>
     
</div>
Posted
Updated 3-May-17 12:42pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900