Re: Function not working

From: Date: Sat, 10 May 2003 23:33:33 +0000
Subject: Re: Function not working
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-147165@lists.php.net to get a copy of this message
Thank you... there are things so simple to do but so hard to think of... :) "Php Developers" <php.dev@mattersolutions.com> escreveu na mensagem news:MABBIENIEJEMOGOCIDLPKEKIEFAA.php.dev@mattersolutions.com... > 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 > > > > > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.476 / Virus Database: 273 - Release Date: 24/4/2003

« previous php.general (#147165) next »