#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    UK
    Posts
    14
    Rep Power
    0
    hi

    i want to show at the end of a link how many records are in the table

    e.g. PHPSCRIPTS (35)

    i am using PHP4, MySQL & Apache
    also using phpMyAdmin

    thanks

    Jonny.

    Scripts4all.com
    http://www.scripts4all.com/
  2. #2
  3. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    England, UK
    Posts
    83
    Rep Power
    15
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    $query = "SELECT * FROM PHPSCRIPTS";
    $result = MYSQL_QUERY($query);
    $number = MYSQL_NUMROWS($result);

    print "PHPSCRIPTS ($number)";
    [/code]

    $number = the number of rows in PHPSCRIPTS (35)

    ------------------
    Girish Gupta
    MusicGoesOn.com
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    UK
    Posts
    14
    Rep Power
    0
    thanks

    :]

    Jonny L
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    UK
    Posts
    14
    Rep Power
    0
    hmmm its giving me a MySQL error on the NUMROWS line

    i have tried changing it to NUM_ROWS

    but still the same error

    wierd
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Newark, DE, USA
    Posts
    39
    Rep Power
    15
    the function is mysql_num_rows()

    ------------------
    ~Chris
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    51
    Rep Power
    15
    no, its @mysql_num_rows

    so it would be:

    $query = "SELECT * FROM PHPSCRIPTS";
    $result = MYSQL_QUERY($query);
    $num_rows = @mysql_num_rows($result);




    ------------------
  12. #7
  13. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    @ is NOT part of the function name, it is an operator. It suppresses error reporting, nothing more.

Similar Threads

  1. League table problem
    By silverduck in forum MySQL Help
    Replies: 8
    Last Post: February 10th, 2004, 01:38 PM
  2. Replies: 11
    Last Post: February 10th, 2004, 12:03 PM
  3. Replies: 0
    Last Post: January 30th, 2004, 03:18 PM
  4. Summing some records in a table
    By oulevon in forum MySQL Help
    Replies: 2
    Last Post: January 25th, 2004, 06:11 PM
  5. how to keep table on top, not centered??
    By vinyl in forum HTML Programming
    Replies: 2
    Last Post: January 20th, 2004, 07:19 PM

IMN logo majestic logo threadwatch logo seochat tools logo