The code follows, adding a prompt to add a failure.
0) {echo "Add success
";} Else{echo "Add failed
";} break; Case "Del"://execute delete break ; Case "Update"://execute modification break ; } Iv. Closure of database Mysql_close ($link);? >
Reply to discussion (solution)
$sql = "INSERT INTO news Valuse (null, ' {$title} ', ' {$keywords} ', ' {$author} ', ' {$addtime} ', ' {$content} ')";
Echo $sql; This step prints normally.
Put this SQL statement into the database to execute and see what's wrong with that.
It could be that dbconfig.php doesn't exist.
It could be that dbconfig.php doesn't exist.
Dbconfig.php, and can be linked normally.
No syntax errors, related files exist
Then you should tell me what's wrong with you.
No syntax errors, related files exist
Then you should tell me what's wrong with you.
The dbconfig.php code is as follows:
The database is as follows:
The title in the database that is not set is not allowed to be empty, but the data you insert is NULL to set the title of the database to allow null
mysql_query ($sql, $link);
Writing
mysql_query ($sql, $link) or Die (Mysql_error ());
Please help me to see what the difference between these two paragraphs:
First paragraph: unavailable//$sql = "INSERT INTO news Valuse (null, ' {$title} ', ' {$keywords} ', ' {$author} ', ' {$addtime} ', ' {$content} ')"; Second paragraph: can be used//$sql = "INSERT INTO news values (null, ' {$title} ', ' {$keywords} ', ' {$author} ', ' {$addtime} ', ' {$content} ')";
If you use the first paragraph above, do not, the second paragraph can be added normally, but did not find out why. Please take a look at it for me.
QQ Wubi Input method is used.
First paragraph: INSERT INTO news Valuse
Second paragraph: INSERT into news values
One is valuse and the other is valuse.
Watch your spelling.