
June 21st, 2000, 06:24 AM
|
|
Junior Member
|
|
Join Date: Jun 2000
Posts: 11
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
define("TABLENAME","soreal");
$db=mysql_connect(localhost,root,password);
mysql_select_db("mydb",$db);
if (!$result=mysql_query('UPDATE '.TABLENAME.' SET name = "'.$name.'" , area = "'.$area.'" , kind = "'.$kind.'" , money = "'.$money.'" , $file_description = "'.$file_description.'" WHERE ID = '.$id,$db)){
echo "<p><h1>Error, I haven't change the fields</h1></p>";
} else {
echo "<p><h1>Fields changed</h1></p>";
}
mysql_free_result($result);
Output will be <p><h1>Error, I haven't change the fields</h1></p> :
WHY????? (if I do on a mysql client 'UPDATE '.TABLENAME.' SET name = "'.$name.'" , area = "'.$area.'" , kind = "'.$kind.'" , money = "'.$money.'" , $file_description = "'.$file_description.'" WHERE ID = '.$id (OF COURSE, I CHANGE THE VARIABLES BY THE VALUES) and works!!!! )
PS: Sorry my bad english ;-)
|