Re: PHP and MySQL
| From: | Jason Wong | Date: | Wed, 11 Dec 2002 20:50:14 +0000 |
| Subject: | Re: PHP and MySQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127898@lists.php.net to get a copy of this message | ||
On Thursday 12 December 2002 04:30, Pushpinder Singh Garcha wrote:
> Hello,
>
> I am using PHP to create forms and then am entering the user input into
> a MySQL DB
> In the first query I am trying to select the values that the user
> entered on the form
>
> THIS DOES NOT WERK.... gives error unable to execute query
> $sql = "INSERT INTO
guest
> (title, first_name,
> last_name,
> login, password,
> passport_number, e_mail,
> question, answer,
> industry, job_title,
> state, city,
> company, last_visit)
> VALUES ('\$select\', \'$f_name\', \'$l_name\',
> \'$login\',
> \'$password\', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
> NOW());";
Not sure why you're escaping the single quote. It's unnecessary -- and I
suspect you mis-escaped $select as well. Any you can use this format, which
IMHO, is a lot easier on the eyes:
$sql = "INSERT INTO guest
SET title = '$title',
first_name = '$first_name',
...,
...,
last_visit = NOW()";
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
I had a lease on an OEDIPUS COMPLEX back in '81 ...
*/