Re: Can anyone tell me why this code doesn't insert anything?
| From: | Richard Davey | Date: | Mon, 23 Feb 2004 17:29:24 +0000 |
| Subject: | Re: Can anyone tell me why this code doesn't insert anything? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-178551@lists.php.net to get a copy of this message | ||
Hello Brian,
Monday, February 23, 2004, 5:11:55 PM, you wrote:
BD> $query = "INSERT INTO invoices
BD>
BD> ('ip','total','creation','first_name','email','session','last_name')
BD> VALUES
BD>
BD> ('0.0.0.0','0.00',NOW(),'Bob','name@domain.com','12345','Smith')";
You shouldn't wrap the column names in quotes. Try:
$query = "INSERT INTO invoices (ip, total, creation, first_name,
email, session, last_name) VALUES ...
If that doesn't work there is probably an error between the query, the
query data and the SQL table structure. Post the SQL table layout so
the values can be checked.
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html