php - Stupid SQL error with no leads -


ok, can't figure out why doesn't work @ all.

$get_data = mysql_query("select * chatbox order id message = 'bla'"); while($data = mysql_fetch_assoc($get_data)) { *blablabla code* } 

this not work. gives me

"warning: mysql_fetch_assoc(): supplied argument not valid mysql result resource" error. (with line number ofcourse)

when remove "where message = 'bla'" part, works fine. tryed , without ' things around bla , around messages. message field excist in db, entry bla. tryed id field in db, number 1, not work @ all. wrong simple line of code. tryed everywhere, can't figure out...

you using where clause after order by, can not work you.

modified query:

select * chatbox message = 'bla' order id 

you need follow sequence when crease mysql select statement:

select .. columns .. .. .. order

select manual reference

side note:

please use mysqli_* or pdo instead of mysql_* because extension deprecated , not available in php 7.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -