Thanx... it worked using double quotes around the variable name ({$HTTP_POST_VARS["varname"]}
----- Original Message ----- From: "Marcelo Leitner" <[EMAIL PROTECTED]> To: "César L. Aracena @hellfire.leitner.homeip.net" <[EMAIL PROTECTED]@hellfire.leitner.homeip.net,> Cc: "PHP DB List" <[EMAIL PROTECTED]> Sent: Sunday, May 26, 2002 5:18 PM Subject: Re: [PHP-DB] INSERT no posible in MySQL > On Sun, May 26, 2002 at 04:59:29PM -0300, =?iso-8859-1?Q?C=E9sar_L. _Aracena?= wrote: > > Hi all, > > > > I have a 3-page form input, where the variables are passed from one page to another using HTTP_POST_VARS and stored in the next one in HIDDEN fields (just to make sure). At the end of the 3rd page, is another one where I thank the visitor and proccess all the data. > > > > The data proccess consist in two steps. First, I save the data into a MySQL DB table (just for record keeping) with an auto_increment id number and Second, the script sends an e-mail to me in order to view the visitor's request. > > > > I haven't got into the email part yet (which it's going to be new to me) because I have this HUGE error when tring to store the data into the DB. What I written is the following (obviusly the db_connect() is well done but not written here): > > > > $query = "INSERT INTO tablename (name, company, specialty, .........) VALUES ($HTTP_POST_VARS['name'], $HTTP_POST_VARS['company'], $HTTP_POST_VARS['specialty'], ..........."; > > $result = mysql_query($query); > > if (mysql_errno()) > > { > > die("<BR>" . mysql_errno().": ".mysql_errno()."<BR>"); > > } > > > > The error that shows is: > > > > Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\apache\htdocs\icaam2\consultas\pres_sent.php on line 3 > > > > Before I used $HTTP_POST_VARS[] I used to get the mysql_errno(): 1046 and 1064 (when using just the variable names). > > > > Where can the problem be? Also, I would be very greatefull if someone could tell me how to send the e-mail using sendmail. > > > > Thanx in advance, > > > > Cesar Aracena > > [EMAIL PROTECTED] > > Neuquen, Argentina > ---end quoted text--- > If you want to php parses "$HTTP_POST_VARS[...]", you must do "{$HTTP_POST_VARS[...]}".. > or "...".$HTTP_POST_VARS[...]."..."; > > []'s > -- > Marcelo R Leitner <[EMAIL PROTECTED]> > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php