FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Pulling my hair out
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Pulling my hair out [message #172405 is a reply to message #172404] Wed, 16 February 2011 18:01 Go to previous messageGo to previous message
Michael Fesser is currently offline  Michael Fesser
Messages: 215
Registered: September 2010
Karma:
Senior Member
.oO(sheldonlg)

> I have this TRIVIAL code and I am pulling my hair out because of it:
>
> <?php
> function getAllEvents() {
> $sql = "SELECT * FROM events
> WHERE eventDate > NOW()
> ORDER BY eventDate LIMIT 4";
> print $sql;
> $result = mysql_query($sql);
> var_dump($result)
> $list = array();
> while ($row = mysql_fetch_assoc($result)) {
> $list[] = $row;
> }
> return $list;
> }
>
> with the two diagnostic included as above. I use the sequel statement
> in phpmyadmin and it yields four entries and they are correct. However,
> the var_dump results in boolean(false) and no results are extracted (of
> course).

What does mysql_error() say?

Micha
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Welcome to PhoToZfAiR
Next Topic: PHP Malaysia Meetup 2011 : Framework Shootout
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 07 13:34:56 GMT 2024

Total time taken to generate the page: 0.05250 seconds