SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    :) delemtri's Avatar
    Join Date
    Jun 2001
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    database problems

    Is there anything wrong with this query?
    $result = mysql_query("select count from counters where countid='$cid'");

    count is an int and countid is a bigint with auto_increment.

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not apparent here, what does the rest of the code look like?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    :) delemtri's Avatar
    Join Date
    Jun 2001
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well what I'm getting is a "not a good MySQL resource" thingamabob when I do $c=mysql_result($result, 0);.

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe there si nothing being returned from the query. A couple of debugging tips.

    1) print the number of rows
    print mysql_num_rows();

    2) Run the query through phpMyAdmn or the command line to see if results are being returned.
    $sql = "select count from counters where countid='$cid'";
    print $sql;
    $result = mysql_query($sql);
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


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
  •