RE: [PHP] Function not working

From: Date: Sat, 10 May 2003 23:13:25 +0000
Subject: RE: [PHP] Function not working
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-147162@lists.php.net to get a copy of this message
sorry just noticed... should be ORDER BY (with space) > Ben wrote > > > you need to put plings '' around date in the query, mysql $result > will be an > incorrect identifier as the sql failed.... > > $sql = "SELECT * FROM materias"; > $sql .= " where id_editoria = $id_editoria "; > $sql .= "AND data = '$date' ORDERBY prioridade LIMIT 1"; > > Rgds, > > Ben > > > From: Dani Matielo [mailto:dmatielo@uol.com.br] > > here I have another problem, now with a function: > > > > function destaque($id_editoria) { > > $date = date("Y-m-d"); > > $result = mysql_query("SELECT * FROM materias where id_editoria = > > $id_editoria AND data = $date ORDERBY prioridade LIMIT 1"); > > $destaque = mysql_fetch_array($result); > > return $destaque; > > }; > > ?> > > > > The error is acused in the line starting with $destaque... what did I do > > wrong? :( > > > [snip] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#147162) next »