SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    First, the below code gives me an error where the mysql_num_rows(); function is called.

    PHP Code:
    $dbConnection mysql_connect($dbHost$dbUser$dbPass);
    mysql_select_db($dbName);

    // Check Database to See If Date Already Exists
    $dateQuery "SELECT date FROM $tableCountDay WHERE date='$numDate'";
    $dateExe mysql_query($dateQuery);
    $numberRows mysql_num_rows($dateExe); 

    Secondly, Is there a way to keep session data even after the browser is closed? Or will have to use a cookie?

  2. #2
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. what error message did you get
    2. only within the specific period before it times out. Use cookie, you could set longer period.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  3. #3
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    It told me that mysql_num_rows(); was not a valid resource.....

  4. #4
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure that you successfully connected to mySQL before do the query. That's normally the case when I get that error
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  5. #5
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Albany, NY
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try pasting the exact query you're trying to make to mysql through telnet/ssh, if it gives back an error then fixing the query should make mysql_num_rows work.
    John Reyes
    HostRocket.com Support

  6. #6
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're getting the "not a valid resource" message, your query has a problem. Either your connection has failed, or perhaps you've used an invaild fieldname in your query...for example, using this query...

    SELECT subject FROM articles WHERE aid='$id'

    ...when the field is called "title" instead of subject, or where there is an "articleid" field, as opposed to an "aid" field.

    Good luck.


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
  •