SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    display data from db

    I'm trying to display the amount of people in my reg_mem table starting at a certain time.
    I had the time stamped into the column date_added when they registered with time().
    Here's what I've got:
    PHP Code:
    $query "select count(*) from reg_mem where date_added <=time()";
    $rs mysql_query($query$db_conn);
    $row mysql_fetch_array($rsMYSQL_NUM);
    $total_email_blast $row[0]; 
    And heres what I call it with in the html part:
    PHP Code:
    <?=$total_email_blast?>

  2. #2
    SitePoint Evangelist achintya's Avatar
    Join Date
    Apr 2005
    Location
    Chandannagar(India)
    Posts
    459
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    what is your problem if you have any?

  3. #3
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It doesn't work.
    I'm not sure which part is screwing it up, and there aren't any error messages.

  4. #4
    SitePoint Evangelist achintya's Avatar
    Join Date
    Apr 2005
    Location
    Chandannagar(India)
    Posts
    459
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    just replace the lines:
    PHP Code:
    $query "select count(*) from reg_mem where date_added <=time()"
    $rs mysql_query($query$db_conn); 
    $row mysql_fetch_array($rsMYSQL_NUM); 
    $total_email_blast $row[0]; 
    with this lines
    PHP Code:
    $query "select * from reg_mem where date_added <=time()";
    $rs mysql_query($query$db_conn); 
    $total_email_blast=mysql_num_rows($rs); 
    I hope it will work. just check it and reply.

  5. #5
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that did not work either, I wonder if it's something with the date_added<=time() part?

  6. #6
    SitePoint Zealot dhantiflag's Avatar
    Join Date
    Mar 2005
    Location
    Mentor, oh
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And heres what I call it with in the html part:
    PHP Code:
    <?=$total_email_blast?>
    just wondering... is that an HTML file or PHP file....


    just humor me


Bookmarks

Posting Permissions

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