Re: [PHP] Parse Error on SQL Insert [Solved]

2006-04-08 Thread Tom Chubb
-Original Message- From: Joe Henry [mailto:[EMAIL PROTECTED] Sent: 07 April 2006 20:53 To: php-general@lists.php.net; [EMAIL PROTECTED] Subject: Re: [PHP] Parse Error on SQL Insert On Friday 07 April 2006 1:37 pm, Tom Chubb wrote: $insertSQL = INSERT INTO cars (model, `year`, details

Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread John Nichel
Tom Chubb wrote: I'm working on an insert record page with a multiple file upload script of which I understand the fundamentals. However, on submission I am getting the following error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or

Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Brad Bonkoski
why do you have single quotes around year? -B Tom Chubb wrote: I'm working on an insert record page with a multiple file upload script of which I understand the fundamentals. However, on submission I am getting the following error: Parse error: syntax error, unexpected

Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Joe Henry
On Friday 07 April 2006 1:37 pm, Tom Chubb wrote: $insertSQL = INSERT INTO cars (model, `year`, details, price, image1, Not sure if this is your problem, but those look like backticks around year instead of single quotes. Should there even be quotes there? HTH -- Joe Henry

Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Tom Chubb
Complete code... ?php require_once('../Connections/damotors.php'); ? ?php function GetSQLValueString($theValue, $theType, $theDefinedValue = , $theNotDefinedValue = ) { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case text:

Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Ray Hauge
On Friday 07 April 2006 12:53, Joe Henry wrote: On Friday 07 April 2006 1:37 pm, Tom Chubb wrote: $insertSQL = INSERT INTO cars (model, `year`, details, price, image1, Not sure if this is your problem, but those look like backticks around year instead of single quotes. Should there even be

RE: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Chrome
://chrome.me.uk -Original Message- From: Joe Henry [mailto:[EMAIL PROTECTED] Sent: 07 April 2006 20:53 To: php-general@lists.php.net; [EMAIL PROTECTED] Subject: Re: [PHP] Parse Error on SQL Insert On Friday 07 April 2006 1:37 pm, Tom Chubb wrote: $insertSQL = INSERT INTO cars (model, `year

Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Brad Bonkoski
thanks for the clarification, I guess the other solution would be to avoid using names with special meaning for column names... -B Ray Hauge wrote: On Friday 07 April 2006 12:53, Joe Henry wrote: On Friday 07 April 2006 1:37 pm, Tom Chubb wrote: $insertSQL = INSERT INTO cars (model,

Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread John Nichel
Tom Chubb wrote: Complete code... snip $insertSQL = INSERT INTO cars (model, `year`, details, price, image1, image2, image3, forsale) VALUES ($_POST['model'], $_POST['year'], $_POST['details'], $_POST['price'], $_FILE['image']['name'][0], $_FILE['image']['name'][1],

Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Ray Hauge
On Friday 07 April 2006 12:56, Chrome wrote: Of course if the field in the DB isn't numeric this would be '{$_POST['model']}' Dan That's what I was thinking. Even if data is a number, I still generally put quotes around it to make sure I don't have an issue. -- Ray Hauge

Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Satyam
PROTECTED] To: 'Joe Henry' [EMAIL PROTECTED]; php-general@lists.php.net; [EMAIL PROTECTED] Sent: Friday, April 07, 2006 9:56 PM Subject: RE: [PHP] Parse Error on SQL Insert Backticks (`) encapsulate table or database names I was thinking maybe if the array references were encapsulated in curly

Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Joe Henry
['model']}' Dan --- http://chrome.me.uk -Original Message- From: Joe Henry [mailto:[EMAIL PROTECTED] Sent: 07 April 2006 20:53 To: php-general@lists.php.net; [EMAIL PROTECTED] Subject: Re: [PHP] Parse Error on SQL Insert On Friday 07 April 2006 1:37 pm, Tom Chubb