Quote:
|
Originally Posted by alirezaok
Why this SQL show "no sucsessfull update" alway ?
<?php
include("config.php");
$Link = mysql_connect ($Host, $User, $Password);
$Query = 'UPDATE $TableName SET `title` = \'test\','
. ' `lid` = \'test\','
. ' `body` = \'test\' WHERE `id` = \'$id\';'
. ' ';
if (mysql_db_query ($DBName, $Query, $Link)) {
print ("<div align=center>successfulle update</div>\n");
} else {
print ("no sucsessfull update");
}
?>
i sure that connect to mysql and table is true because row delete works but update not works ...
|
A couple of thoughts...
1. Are the 3 references to 'test' all supposed to be the named test, or did you substitute 'test' for another word?
2. Try your query like this...
$Query=("UPDATE $Tablename SET title='$test', lid='$test', body='$test' WHERE id='$id'");
3. Is the information you're updating coming from another form, and is it passing the information to this properly?