PHP REEEEEEEE

$tsql = "INSERT INTO dbo.order(order_client,
order_contact,
order_vendor,
order_iteminfo,
order_ourcost,
order_ourshipping,
order_pricequote,
order_shipquote,
order_shipinfo,
order_requestor)
VALUES (?,?,?,?,?,?,?,?,?,?)";

$params = array(&$_POST['order_client'],
&$_POST['order_contact'],
&$_POST['order_vendor'],
&$_POST['order_iteminfo'],
&$_POST['order_ourcost'],
&$_POST['order_ourshipping'],
&$_POST['order_pricequote'],
&$_POST['order_shipquote'],
&$_POST['order_shipinfo'],
&$_POST['order_requestor']);

>[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near the keyword 'order'.
>near the keyword 'order'.
>'order'.

Thanks that helps.

that's some terrible nomenclature man

why so many business people not realize that table/object/etc names contextually describe their fucking members is beyond me

Why is that bad? Would you rather have it named 'obj1', 'obj2', etc?

It really doesn't matter what it's called. It's just easy reference for me. It's worked on a number of other scripts I just don't know why this is giving me this error. I might have to go home and get drunk tonight and then come back at it with a fresh set of eyes in the morning.

I see where you're go I'll modify the tables and take 'order' out of it.

Holy shit get out of that hell as soon as possible

Nevermind, duh. I see where you were going with this. I'll take 'order' out all together except for the table name.

>has a terribly designed database with terribly named tables containing terribly named columns
>writes terribly ugly code to bind raw user-supplied data to a syntactically incorrect parametrized query
>gets an error message from the DBMS
>blames PHP
Is your name Pajeet?

>VALUES (?,?,?,?,?,?,?,?,?,?)";

I couldnt have said it better, thank you

>takes out 'order'
>same error message

wew

He was talking about the order_ prefixes you retard.

It's just a temporary test database for a demonstration for further development.

>damage controlling this hard
Come on user, everyone knows it's your production code

No I just need something in place for orders like, right now. It's just a temporary setup.

I don't have time to make it pretty yet. I did similar code for the client list and it worked just fine.

I know trolling me is fun, but I'm just not seeing the syntax error.

Then use phpmyadmin

Try Gentoo

I'm using SQL express though, not MySQL

Ok this works:

$tsql = "INSERT INTO dbo.client(client_name,
client_phone,
client_address,
client_city,
client_state,
client_zip)
VALUES (?,?,?,?,?,?)";

$params = array(&$_POST['client_name'],
&$_POST['client_phone'],
&$_POST['client_address'],
&$_POST['client_city'],
&$_POST['client_state'],
&$_POST['client_zip']);

But not this:

$tsql = "INSERT INTO dbo.order(client,
contact,
vendor,
iteminfo,
ourcost,
ourshipping,
pricequote,
shipquote,
shipinfo,
requestor)
VALUES (?,?,?,?,?,?,?,?,?,?)";

$params = array(&$_POST['order_client'],
&$_POST['contact'],
&$_POST['vendor'],
&$_POST['iteminfo'],
&$_POST['ourcost'],
&$_POST['ourshipping'],
&$_POST['pricequote'],
&$_POST['shipquote'],
&$_POST['shipinfo'],
&$_POST['requestor']);

I don't see what I'm missing here.

>I don't see what I'm missing here.
Because you're a retard who should never touch the keyboard. Really, consider killing yourself.

GOT IT!!!

'order' is a reserved word, I changed it to:

INSERT INTO dbo.[order](client,

And it worked.

t. dumbass faggot who can't figure out what the problem was.

Not being able to figure out the problem from an error message explicitly mentioning _keyword_ 'order' is not why you should consider changing profession to shoveling shit. Inserting user supplied data to a disgusting, non-normalized database using ugly as fuck PHP code is. People like you are the reason why everyone shits on PHP more than it actually deserves, Pajeet.

But I did figure it out by that metric you dumb fucking NEET. Are you employed?

The first response prompted me to take the dozens of 'order' prefixes out which was actually helpful advice.

That helped me narrow it down. Upon further research, I found out that 'order' is a reserved word and put it in brackets []. This solved the problem.

Please kill yourself immediately you retard.

databased called "erp" or something
table called "order"
column called "iteminfo"

full path erp.order.iteminfo. concise as fuck.

please normalize also. you should have an "order" table and an "order_products" (or something) table with a one-to-many relation between the two.

Thanks for the advice. I am building an ordering table for adding in relational tables that I'm developing, but for now I just needed something today as our other ordering software is expired and we had literally nothing.

I got the problem narrowed down and it's running for now. Thanks user you saved my ass.

> 2016
> using PHP and not RUBY master race

Standard parameter binding, granted, the sane among us would use ?1, ?2, ?3 or :client, :contact, :vendor.

That said, I fucking hate it when people do that shit. I'm in the goddamned order table, I know it's the id of the fucking order, you don't need to name it order_id. I can tolerate that shit with foreign keys, but I'd prefer that it was the table name and we can assume that it maps to the primary key.

I bet whoever designed this schema inserts delimited strings and thinks they're being clever.