Jump to content



Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
Photo
* * * * - 1 votes

Mysql Dates


1 reply to this topic

#1 FirefoxRocks

FirefoxRocks

    Super Member

  • [HOSTED]
  • 988 posts
  • Gender:Male
  • Location:Ontario, Canada
  • myCENTs:92.36

Posted 29 January 2009 - 12:07 AM

I'm trying to select records that have an ending event date/time after the current date/time. I have tried using a PHP variable $now=date("Y-m-d H:i:s");, CURDATE() as well as UNIX_TIMESTAMP in combination with strtotime("now");, but so far nothing is working.

SELECT * FROM `events` ORDER BY `eventStart` WHERE `eventEnd`>$now

Somehow I keep getting this error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/portal/public_html/sandbox/<blocked>/calendar/calendar.php on line 63

The eventEnd field is a MySQL datetime field: "YYYY-MM-DD HH:mm:ss"

How do I do this?

Edited by FirefoxRocks, 29 January 2009 - 12:07 AM.


#2 FlashNet

FlashNet

    Newbie [ Level 1 ]

  • Members
  • 2 posts

Posted 23 April 2009 - 02:22 PM

What code are you using for parce response from db?

I suppose that mysql returns number of rows ( > 1). So you can't use such result with mysql_fetch_array() . In this case you have to use mysqli_multi_query. Examples ca be found here.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users