curdate() not workming?

    Date: 07/06/06 (MySQL Communtiy)    Keywords: mysql, database, sql

    Maybe it's the code or something else, but... should this work? I am trying to export some data from the database.

    -----------------------------------

    $now1 = curdate();
    $now2 = $now1[0];
    $future = $now2 + 2419200;

    $query = "SELECT * FROM ibf_cal_events WHERE event_unix_from BETWEEN $now2 AND $future ORDER BY event_unix_from";

    $result = mysql_query( $query );
    $start = 1;
    $end = mysql_num_rows( $result );
    $items=0;
    $title_array = array ();
    $context_array = array ();

    while( $start <= $end ) {
    $row = mysql_fetch_row( $result );
    $id = $row[0];

    -----------------------------------

    This gave me an error message:

    Fatal error: Unknown function: curdate() in /importcalevent.php on line 18

    Line 18 is $now1 = curdate();

    I tried $now1 = getdate(); and I got this error message:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /importcalevent.php on line 31

    Line 31 is $end = mysql_num_rows( $result );

    So I am not sure whch is correct and which is incorrect.

    I am using MySQL 4.1

    Thanks all.

    Source: http://community.livejournal.com/mysql/99541.html

« MySQL is used in most of... || Newbie trying to create a... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home