Results 1 to 3 of 3

Thread: PHP Help

  1. #1
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default PHP Help

    PHP Code:
    $query mysql_query("SELECT * FROM `users` ORDER BY `abc`");
     while(
    $info mysql_fetch_array($query)) {
      echo 
    '<a href="index.php?user='.$info['username'].'">'.$info['username'].'</a> <br />';
     } 
    I get mysql_fetch_array is not a valid resource blah blah blah. I haven't done php in a while so I can't remember how to troubleshoot it.

    edit:

    i have the same problem here:
    PHP Code:
     $query mysql_query("SELECT * FROM users ORDER BY abc");
     while(
    $list mysql_fetch_array($query)) {
      echo 
    '<a href="profile.php?user='.$list['username'].'">'.$list['username'].'</a> <br />';
     } 
    Last edited by Trigs; 24-07-2009 at 05:16 PM.
    Vouches
    [x][x]

  2. #2
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    Just looking over it, on ORDER BY you need to specify a table - then a type.

    Code:
    SELECT * FROM `users` ORDER BY `table` ASC
    As an example.

  3. #3
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    Aha thanks. +rep
    Vouches
    [x][x]

Posting Permissions

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