note 33126 deleted from function.mysql-query by didou
| From: | didou@php.net | Date: | Tue, 17 Jun 2003 13:26:45 +0000 |
| Subject: | note 33126 deleted from function.mysql-query by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-50487@lists.php.net to get a copy of this message | ||
Note Submitter: nemekhbayar@rocketmail.com
----
There was one thing that caused me a lot of trouble as I was trying to launch an "INSERT INTO
(...) VALUES(...)" query with mysql_query() command. The variables passed to the *.php file by
<form method="get" action="..."> should be put between quotes (') in
the VALUES clause. For example, it should be:
$query = "INSERT INTO table (field) VALUES('$variable')";
and NOT
$query = "INSERT INTO table (field) VALUES($variable)";
It took me a whole day to debug. It doesn't even send any error messages. The only clue I had
was a "Query failed" message in response to:
mysql_query($query) or die("Query failed")
I hope this'll be of help to someone