My guess is you don't have register_globals on. Replace each variable with
$_POST['field_name'] or $_GET['field_name'] depending on what your form's
method is. You could also turn register_globals on but that is a security
risk I've heard.


----- Original Message -----
From: "Pushpinder Singh Garcha" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 11, 2002 3:30 PM
Subject: [PHP] PHP and MySQL


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());";

WHEN I TRY TO HARD CODE THE VALUES INTO THE MYSQL QUERY, IT WERKS FINE

//  $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 (\'gh\', \'ghdfghhgj\', \'hgddj\', \'ggfgfg\', \'hfgdj\', NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NOW());';

Can somebody please tell me where I am going wrong..??

Many thanks

Pushpinder Singh Garcha
_________________________________
Web Architect
T. Falcon Napier and Associates, Inc.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to