note 37274 added to function.mysql-query
| From: | ((Art)) | Date: | Sat, 08 Nov 2003 02:17:30 +0000 |
| Subject: | note 37274 added to function.mysql-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-60134@lists.php.net to get a copy of this message | ||
hey
**
Adding this note in for others who are new to updating data using PHP (like me)
if you are to update data in your database using PHP and you are using variables in your UPDATE sql
statement, remember to keep in the single quotes around each variable otherwise the data will not be
updated.
$sql = "
UPDATE public
SET field1 = '$var1', field2 = '$var2', field3 = '$var3'
WHERE ID = $varID
";
thought this might help the random searcher
----
Manual Page -- http://www.php.net/manual/en/function.mysql-query.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37274
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37274&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37274&report=yes
Search -- http://master.php.net/manage/user-notes.php