user1825668
user1825668

Reputation: 37

query was empty on update

I have a "query was empty" problem on an update.

my query is :

$infnav = mysql_query(utf8_decode("UPDATE `Opérations n°1` SET nomnav='$nomnav', typenav='$typenav', callsign='$callsign', imo='$imo', mmsi='$mmsi', immat='$immat', proprio='$proprio', portbase='$portbase', flag='$flag', long='$long'"));

my query working perfectly when i remove long='$long'. When i put data in long, an echo $long; return the correct value and return the query was empty error.

please help

Upvotes: 1

Views: 135

Answers (1)

John Woo
John Woo

Reputation: 263733

it's because you have a syntax error on your query, LONG is a RESERVED Word so you should escape it using backtick

UPDATE ...... portbase='$portbase', flag='$flag', `long`='$long'

and your query is vulnerable with SQL injection, please read the article below to protect from it,

Upvotes: 1

Related Questions