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!

Replying to Mysql Dates


Post Options

    • Can't make it out? Click here to generate a new image

  or Cancel


Topic Summary

FlashNet

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.

FirefoxRocks

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?

Review the complete topic (launches new window)