Gossamer Forum
Home : General : Internet Technologies :

PHP sql_query() ...

Quote Reply
PHP sql_query() ...
I seem to be having a bit of a problem with sql_query in a PHP script I'm working on (will be an accounts area for people who have purchased my plugins..so they can login and gt the most upto date version available).

I am using;

Code:
$getmessage = "INSERT INTO `Accounts` (`Name`,`Email`,`Password`,`$item_name`) VALUES ('$first_name','$payer_email','$password','1'";
$result = mysql_query($getmessage);

if (!$result) {
$error = mysql_error();
error("Unable to get details on email account stuff...Reason: $error (code run: $getmessage)", $connection);
}

The query that comes out, is;

INSERT INTO `Accounts` (`Name`,`Email`,`Password`,`MyFaves`) VALUES ('Andrew','andy.newby@ace-installer.com','0.014feEse0.01','1')

But for some reaoson I get an error saying;

Quote:
You have an error in your SQL syntax near '' at line 1

The most weird part of it, is the fact that it will run the printed out SQL query fine via MySQLMan....which makes me come to the conclusion its something to do with the way I'm running it.

Any ideas?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread PHP sql_query() ... Andy 4453 Mar 3, 2003, 3:31 AM
Thread Re: [Andy] PHP sql_query() ...
Paul 4275 Mar 3, 2003, 3:45 AM
Thread Re: [Paul] PHP sql_query() ...
Andy 4326 Mar 3, 2003, 3:49 AM
Thread Re: [Andy] PHP sql_query() ...
Paul 4269 Mar 3, 2003, 3:55 AM
Post Re: [Paul] PHP sql_query() ...
Andy 4318 Mar 3, 2003, 3:58 AM