I got two tables on a database but I dont know how to run independently. All I want is each table to run independently once tracked.
the first table is doing ok, but i dont know how to put the second table in the coding.
<?php
mysql_connect ("localhost" , "root","") or die (mysql_error()) ;
mysql_select_db ("maklumatpesak it");
$term = $_POST['term'];
$sql = mysql_query("se lect * from main where NoID like '%$term%'");
while ($row = mysql_fetch_arr ay($sql)){
echo 'ID: '.$row['NoID'];
echo '<br/> Name: '.$row['Name'];
echo '<br/> Age: '.$row['Age'];
echo '<br/> Date Of Birth: '.$row['DateOfBirth'];
echo '<br/> Sex: '.$row['Sex'];
echo '<br/> Race: '.$row['Race'];
echo '<br/> Status: '.$row['Status'];
echo '<br/> Address: '.$row['Address'];
echo '<br/> Contact No: '.$row['NoTel'];
echo '<br/> Religion: '.$row['Religion'];
echo '<br/> Mode of Transport: '.$row['MobPatient'];
echo '<br/> Patient Mobility: '.$row['PatientMob'];
echo '<br/> Reference: '.$row['Reference'];
echo '<br/><br/>';
}
?>
my second table is 'reference', where the echo show the data from the table reference in my database. i just want to call from the table to show the data in echo but i cant figure how to do this.
pls help.
the first table is doing ok, but i dont know how to put the second table in the coding.
<?php
mysql_connect ("localhost" , "root","") or die (mysql_error()) ;
mysql_select_db ("maklumatpesak it");
$term = $_POST['term'];
$sql = mysql_query("se lect * from main where NoID like '%$term%'");
while ($row = mysql_fetch_arr ay($sql)){
echo 'ID: '.$row['NoID'];
echo '<br/> Name: '.$row['Name'];
echo '<br/> Age: '.$row['Age'];
echo '<br/> Date Of Birth: '.$row['DateOfBirth'];
echo '<br/> Sex: '.$row['Sex'];
echo '<br/> Race: '.$row['Race'];
echo '<br/> Status: '.$row['Status'];
echo '<br/> Address: '.$row['Address'];
echo '<br/> Contact No: '.$row['NoTel'];
echo '<br/> Religion: '.$row['Religion'];
echo '<br/> Mode of Transport: '.$row['MobPatient'];
echo '<br/> Patient Mobility: '.$row['PatientMob'];
echo '<br/> Reference: '.$row['Reference'];
echo '<br/><br/>';
}
?>
my second table is 'reference', where the echo show the data from the table reference in my database. i just want to call from the table to show the data in echo but i cant figure how to do this.
pls help.
Comment