RE: [PHP] insert problem
| From: | John W. Holmes | Date: | Mon, 26 May 2003 16:22:34 +0000 |
| Subject: | RE: [PHP] insert problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148996@lists.php.net to get a copy of this message | ||
> im conduction INSERT query to my database
> but ive no success, its weird that my user in the
> database have ALL priveledges. i can insert
> through the command line but on my php
> script wont
>
> this is my simpel query
>
> INSERT INTO information VALUES($name, $email, $age, $location, $tel)
Well, you probably need some quotes around those variables in the query,
since I assume they are strings.
INSERT INTO information VALUES('$name', '$email', $age, '$location',
$tel)
Either way, check mysql_error() after you run your query to see what the
problem is.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/