For example, there are apple,banna,lemon,orange four tables in a MSQ database, where the Apple table has brand,color,name,comment four fields that require the lookup of name to modify or delete the comment data. How do I write with a full SQL statement? (To ensure successful operation of the example, pay special attention to the specification of punctuation)
PHP Write
Reply to discussion (solution)
What database is used?
The database used is MySQL
Update Apple set ' comment ' = ' xxx ' where name= ' AA '
Is the set followed by double or single quotation marks?
(Below is the complete code, I do not know where is wrong?) It seems to be a grammatical quote problem)
Session_Start ();
if (Isset ($_session[' Nowuser ')) {
$username = $_session[' Nowuser ');
$reason =$_post[' reason '];
Check Forms
if (strlen ($reason) >0) {
$sql = "SELECT * from Module1 where Username= '". $username. "' ";
Update reason set ' comment ' = ' $reason ' where name= ' $username ';
$sql = "INSERT into Module1 (reason) VALUES (' reason ')";
if (mysql_query ($sql, $conn))
Exit (' Submit success! );
Else
echo "Submit failed! ";
}else{
Exit (' Please fill out the blanks and submit! ');
}else{
Exit (' not logged in! return ');
?>