Ciao a tutti ho un problema, ho questa query mi piacerebe sapere perchè non funziona qualcuno ha qualche idea????
Vi prego aiutatemi...
codice:$res = $db->query("SELECT Lat,Lng FROM storico WHERE IMEI=$IMEI ORDER by Data DESC");
Ciao a tutti ho un problema, ho questa query mi piacerebe sapere perchè non funziona qualcuno ha qualche idea????
Vi prego aiutatemi...
codice:$res = $db->query("SELECT Lat,Lng FROM storico WHERE IMEI=$IMEI ORDER by Data DESC");
$IMEI è un numero o una stringa?
prova in questo modo
codice:SELECT Lat,Lng FROM storico WHERE IMEI='$IMEI' ORDER by `Data` DESC
Prova ad eseguire la query evidenziando l'errore, e poi scrivi l'errore sul forum, in modo che possiamo darti una mano..
Ecco come fare:
Codice PHP:
$res = $db->query("SELECT Lat, Lng FROM storico WHERE IMEI=$IMEI ORDER by Data DESC") or die("ERRORE: ".mysql_error());
Strumenti per Webmaster gratuiti by IceLab
Questo è l'errore che mi da.
codice:Catchable fatal error: Object of class DB_result could not be converted to string in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\sipe\mappa.php on line 64
Quale classe/libreria PHP stai utilizzando per la gestione del DB?
Perchè questo errore segnala probabilmente che quello che ti ho dato io non è il metodo esatto per riscontrare l'errore sulla query..
Strumenti per Webmaster gratuiti by IceLab
Grazie nicola75ss avevi ragione dovevo passare $IMEI come stringa.