Results 1 to 5 of 5

Thread: display total records in a table resolved

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Location
    somewhere you don't want to be
    Posts
    29

    display total records in a table resolved

    I'm having a problem trying to display the results of this query on my web page the query is
    SELECT count(*) from stories

    how can i display the results?
    Last edited by egiggey; Oct 16th, 2002 at 02:33 PM.

  2. #2
    Lively Member
    Join Date
    Sep 2002
    Posts
    100
    set your recordset = to the command, then call it from your recodset as RS->Fields['count(*)']->value

    toto

  3. #3
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    echo mysql_num_rows(mysql_query("select * from tableName"));
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  4. #4
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    toto what the hell are you talking about? he isn't doing a class and you didn't explain yourself very well, because that won't work.

    egiggey: you need to fetch the query using mysql_fetch_array() to display the query results.

    mysql_num_rows will only show how many rows it found.


    $query = mysql_query("SELECT count(*) from stories");

    while ($row= mysql_fetch_array($query)){
    echo $row['change to field in stories'];
    }

    then that will show the results of the query

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Location
    somewhere you don't want to be
    Posts
    29
    Thanks php man
    I was close to what you posted and got frustated. i knew someone on vbforums would straignten me out

Posting Permissions

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



Click Here to Expand Forum to Full Width