SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast uni's Avatar
    Join Date
    Aug 2003
    Location
    East Coast
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What is wrong here?

    $qstr = "SELECT DISTINCT v.vId AS video_id, v.vName AS video_name, v.vThumb AS video_thumb, v.vDescription AS video_description, c.cName AS category_name FROM videos v LEFT JOIN categories c ON c.cId=v.vInCategory WHERE v.vInCategory = $cid $order $sort";

    $count = 0;
    $videos = mysql_query($qstr);
    while (list ($vid, $vname, $vthumb, $vdescription) = mysql_fetch_row($videos))
    What am I missing here? I get the error:
    Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/X/public_html/X/X.tpl on line 26

    Line 26 is:
    while (list ($vid, $vname, $vthumb, $vdescription) = mysql_fetch_row($videos))
    Ahh please help!
    - un1x
    Content Sites:A|B
    Blogs:My Blog

  2. #2
    SitePoint Wizard
    Join Date
    Jan 2004
    Location
    3rd rock from the sun
    Posts
    1,005
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why dont you paste that query into PhpMyAdmin or whatever you use to manage your db - with some real values instead of $cid, order sort and make sure your sql statement is cool.

    Then you are in a position to chase it back thru php, pointless looking at PHP if the sql is knackered.
    isempty()

  3. #3
    SitePoint Enthusiast uni's Avatar
    Join Date
    Aug 2003
    Location
    East Coast
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol, I just figured it out after posting this.. thanks to those who tried :P
    - un1x
    Content Sites:A|B
    Blogs:My Blog


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
  •