/    Sign up×
Community /Pin to ProfileBookmark

MySQL Query Error.

Please help.. in my code

mysql_query(“INSERT INTO items (cat,number,short,price,long,size,c1n,c1v,c2n,c2v,c3n,c3v,o1n,o1v,o2n,o2v,o3n,o3v,y1n,y1v,y2n,y2v,y3n,y3v) VALUES ($_POST[id], $_POST[number], $_POST[short], $_POST[price], $_POST[long], $_POST[size], $_POST[c1n], $_POST[c1v], $_POST[c2n], $_POST[c2v], $_POST[c3n], $_POST[c3v], $_POST[o1n], $_POST[o1v], $_POST[o2n], $_POST[o2v], $_POST[o3n], $_POST[o3v], $_POST[y1n], $_POST[y1v], $_POST[y2n], $_POST[y2v], $_POST[y3n], $_POST[y3v])”);

I get the following error happens..

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘long,size,c1n,c1v,c2n,c2v,c3n,c3v,o1n,o1v,o2n,o2v,o3n,o3v,y1n,y

No idea why!

Please help.

Andrew

to post a comment
Full-stack Developer

2 Comments(s)

Copy linkTweet thisAlerts:
@theredguyMay 10.2003 — isn't "long" directing to "long integer" wich you can't use, because it's a command? maybe if you us another name it'll work then.

Don't attack me if it didn't solve your problem, i have little programming background an almost none at webpages/sql
Copy linkTweet thisAlerts:
@iceafreak99authorMay 10.2003 — [i]Originally posted by theredguy [/i]

[B]isn't "long" directing to "long integer" wich you can't use, because it's a command? maybe if you us another name it'll work then.



Don't attack me if it didn't solve your problem, i have little programming background an almost none at webpages/sql [/B]
[/QUOTE]


Thanks you nailed it :p
×

Success!

Help @iceafreak99 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...