Saving data to database

Hey guys,

I have 2 problems.

1st, when I want to update multiple values, I tried:
$sqlRequest = “UPDATE gvntools_msg SET title = ‘$title’ AND body=‘$body’ AND videoID=‘$videoID’ WHERE username = ‘$username’”;

What would be a correct syntax? Because it wont save the results.

Also, I wanna store a private message in database. As its plain text I decided to go simply with VARCHAR(1000). Saves fine, but I have a problem getting it inside textarea.
Message:<br /><textarea name=\“body\” cols=\“40\” rows=\“10\” maxlength=\“1000\” value=\“$body\”></textarea>

It won’t display a thing. Here is how I get $body var:
$body = mysql_result($result, 0, ‘body’);

Help, thanks :slight_smile:

Oh, dumb me, OC textarea value isnt as value parameter but inside ><. Also, comma should do the job.

Thanks a ton :slight_smile:

$sqlRequest = "UPDATE gvntools_msg SET title = '".$title."', body='".$body."', videoID='".$videoID."' WHERE username='".$username."'";
Edit:

Stop typing so fast! :wink:


$sqlRequest = "UPDATE gvntools_msg SET title = '$title' AND body='$body' AND videoID='$videoID' WHERE username = '$username'";

Should be :


$sqlRequest = "UPDATE gvntools_msg SET title = '$title', body='$body',videoID='$videoID' WHERE username = '$username'";

And with textarea, try as follows:


echo '<textarea name="body" cols="40" rows="10" maxlength="1000">' . $body . '</textarea>';

hello jan1024188,

Try to echo following query and see what you are getting

$sqlRequest = mysql_query("UPDATE gvntools_msg SET title = '$title' AND body='$body' AND videoID='$videoID' WHERE username = '$username'");