Re: PHP and MySQL

From: Date: Wed, 11 Dec 2002 21:53:50 +0000
Subject: Re: PHP and MySQL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-127911@lists.php.net to get a copy of this message
Thanks Jason...that werked fine for me.. --pS On Wednesday, December 11, 2002, at 03:50 PM, Jason Wong wrote:
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 ... */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#127911) next »