[thelist] PHP MYSQL INSERT PROBLEM

Joshua Hmielowski jhmielowski at comcast.net
Wed Oct 15 10:29:36 CDT 2003


Jay hit it on the head!

"Use backticks to make things clear in PHP around table & column names
(its good practice and save frustration)
$query = "INSERT INTO `ceramictiles` (`id`, `vender#`, `thumbpath`,
`largepath`)
VALUES ('$id','$vender', '$thumb', '$large')";

My guess is that the # sign is throwing the error here, or else 'vender'
should be 'vendor'"

I could not get an echo of the $query so I could not see what was going 
on. It would err before it could echo.
But it must not have liked the # sign with in 'vender#' so the 
`backticks` were the problem solver.
all works just fine now!

Thanks Jay
that was a serious stress saver!
Josh

On Wednesday, October 15, 2003, at 09:01 AM, Joshua Olson wrote:

> ----- Original Message -----
> From: "Joshua Hmielowski" <jhmielowski at comcast.net>
> Sent: Wednesday, October 15, 2003 10:29 AM
>
>
>> connected ok You have an error in your SQL syntax near '' at line 1
>
>> as you can see the SQL is no where near line one and I have had this
>> exact sql insert statement running and
>> printing to the screen exactly what it was supposed to.
>
> Josh
>
> The PHP parser doesn't check SQL syntax, therefore it must be the 
> database
> itself that it throwing the error.  Given than, line 1 refers to line 
> of the
> SQL, not the page's source code.
>
> To isolate the syntax error, what we need to see is the result of "echo
> $query"
>
> <><><><><><><><><><>
> Joshua Olson
> Web Application Engineer
> WAE Tech Inc.
> http://www.waetech.com
> 706.210.0168
>
> -- 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



More information about the thelist mailing list