Jump to content

Recommended Posts

Hi.

i don't know my query result is replicating itself.

tried my head out, someone pls help before i go bananas

 

if(isset($_POST['Submit'])){
$search = $_POST['search'];
if($search ==''){
echo "<font size=3 color=red><b>Search field empty. <input type='button' value='Try Again' onClick='history.go(-1)'><br>";
}else{


$query = "SELECT t1.ParcelDesc, t1.DeliveryAddress, t1.New_Address, t2.status, t2.remarks FROM parcels t1 JOIN parcel_status t2 ON t1.Email=t2.username WHERE t1.ParcelDesc = '$search' AND t1.Email = '$_SESSION[username]' ";
$result = (mysql_query($query));


if(mysql_num_rows($result) < 1){
echo ("<font size=3 color=red><b>No Match Found. <input type='button' value='Try Again' onClick='history.go(-1)'>");
}else{

$num_rows = mysql_num_rows($result);
//print "There are $num_rows records.<P>";
echo "<table width= '100%' border='1' bordercolor='#000000' cellpadding='1' cellspacing='1'>
<tr >
<th>Parcel-Desc</th>

<th>Recipient Name & Address</th>

<th>New Address</th>

<th>Remarks</th>

<th>Status</th>
</tr>";
while ($get_info = mysql_fetch_row($result)){ 
print "<tr >\n";
foreach ($get_info as $field) 
print "\t<td ><font face=arial size=2/>$field</font></td>\n";
print "</tr>\n";
}
print "</table>\n";
print "<br>";
//mysql_close($link);
}


}

}

Link to comment
https://forums.phpfreaks.com/topic/202759-data-replication/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.