-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
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
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
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
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:
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
://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
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,
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],
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
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
['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
12 matches
Mail list logo