tags:

views:

37

answers:

4

I have few values existing in data base,i need to update them but,i am unable to do it.

UPDATE Phone SET dcno='1' WHERE number='1' AND date='12/03/2009' AND dcnodate='11/05/2009' AND yourorderno='1' AND orderdate='23/06/2010' AND vendorcode='2222

Couldn't execute query: 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 ''2222' at line 3

I also need to print 3db value in to one form,i m unable to do it.

Any help ii be appreciated.

http://dpaste.com/hold/185341/

A: 

looks to me like you're missing the ' from the 2222.

try running that query in your database see what happens

Rob
Nope,Still i m getting that error.Now,it is echoing that it has updated but it isnt reflecting in db.
DAFFODIL
then my only thoughts would be the where clause in your statement is preventing it from working. Either that or you havent reloaded the table??
Rob
A: 

There is a missing quote at the end:

vendorcode='2222

In the code the quote is missing at two places where UPDATE is being used:

....vendorcode='{$good_data['vendorcode']}'";
codaddict
Nope,Still i m getting that error.Now,it is echoing that it has updated but it isnt reflecting in db.
DAFFODIL
A: 

You are missing ending quote for last parameter:

"... AND vendorcode='{$good_data['vendorcode']}'";

To prevent such errors in future you should use mysqli_prepare with mysqli_stmt_bind_param. You'll find example on manual page.

Ivan Nevostruev
Nope,Still i m getting that error.Now,it is echoing that it has updated but it isnt reflecting in db.
DAFFODIL
A: 

Hello,

Here would be two solutions.

1) add vendorcode='2222';

2) remove vendorcode=2222;

Kanak Vaghela