Thread: Data Table !?
View Single Post
Old Apr 5th, 2006, 7:33 AM   #11
ASHORY
Programmer
 
ASHORY's Avatar
 
Join Date: Dec 2004
Location: Egypt
Posts: 30
Rep Power: 0 ASHORY is on a distinguished road
Send a message via ICQ to ASHORY Send a message via MSN to ASHORY Send a message via Yahoo to ASHORY
i thinked about it i made a code but i dont know if it works or not
this code work is to see if the field is changed or not and if its changed update the changed field in the database , then echo's the changed fields in a new table without the non changed ones

here it is

[PHP]
<?
include ("connect.php") ;
$Con_Code="SELECT * From AddressBook";
$Con_Query=mysql_query($Con_Code);
$Con_Num=mysql_num_rows($Con_Query);
$i=0;
while ($i < $Con_Num){
$DB_Name=mysql_result($Con_Query,$i,"ID");
$DB_Name=mysql_result($Con_Query,$i,"Name");
$DB_City=mysql_result($Con_Query,$i,"City");
$Saved_City=$_GET['City'.$i] ;
if ($Saved_City=$DB_City){
$i++;
}
else{
echo '<h1 align=center>'."Saved Entries".'</h1>'.'<br>';
echo '<table border="2" width="100%" cellspacing="0" cellpadding="0" bordercolor="#000000">';
echo '<tr>';
echo '<td>';
echo "ID";
echo '</td>';
echo '<td>';
echo "Name" ;
echo '</td>';
echo '<td>';
echo "City" ;
echo '</td>';
echo '</tr>';
$Up_Code="UPDATE AddressBook SET City='".$Saved_City."' WHERE Name='".$DB_Name."'";
$Up_Query=mysql_query($Up_Code);
$DB_City2=mysql_result($Con_Num,$i,"City");
echo '<tr>';
echo '<td>';
echo $DB_ID;
echo '</td>';
echo '<td>';
echo $DB_Name;
echo '</td>';
echo '<td>';
echo $DB_City2;
echo '</td>';
echo '</tr>';
echo '</table>';
$i++;
}
}
?>
[/PHP]
__________________
"^Ahmed.SHOukRY^"
http://www.ashory.741.com
ASHORY is offline   Reply With Quote