Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2011
    Posts
    79
    Thanks
    7
    Thanked 0 Times in 0 Posts

    script for query a db help needed

    i have the following code in php:
    PHP Code:
    <?php
    error_reporting 
    (E_ALL);

    $host="localhost"// Host name
    $username="elemental"// username
    $password="rclogin"// password
    $db_name="traffic2"// Database name
    //$rc_profile_table="rc_profile_table"; // Table name
    //$rc_profile_relation_table="rc_profile_relation_table"; // Table name

     
    mysql_connect("$host""$username""$password");
    mysql_select_db("$db_name");
                                    
    $sql="SELECT created_at FROM rc_profile_table where created_at > 2011-04-19 08:00:00";
    $result=mysql_query($sql);
    $count=mysql_num_rows($result);

    $sql="SELECT created_at FROM rc_profile_relation_table where created_at > 2011-04-19 08:00:00";
    $result2=mysql_query($sql);
    $count2=mysql_num_rows($result);

     
    mysql_close();

    ?>

    am i on the right path please?
    thank you
    Last edited by helloise; 04-20-2011 at 01:16 PM. Reason: RESOLVED

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    echo $count and $count2 to see if they contain results. You may have to put the date times in single quotes.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •