Updating number of rows in tables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott Brown

    Updating number of rows in tables

    Hello,
    I want to write a script that will display a table with a number of
    rows the user wants. Example, I go to a page and need 30 rows, I press
    submit and 30 rows are made.
    I was thinking of a FOR EACH statement, but those examples are for
    arrays.

    Any ideas?

    Scott n7seb@softhome. net
  • BKDotCom

    #2
    Re: Updating number of rows in tables

    like so? or are you even talking about SQL? If not, what's are these
    rows?? They've got to come from somewhere. 30 rows of what?

    $query = '<snip> LIMIT '.$POST['num_rows_reque sted'];
    $result = mysql_query($qu ery);
    $numrows = mysql_num_rows( $result); // 'num_rows_reque sted' ??
    echo '<table>';
    for ( $i=0; $i<$numrows; $i++ ) {
    $row = mysql_fetch_ass oc($result);
    echo '<TR><TD>'.$ro w['column'].'</TD></TR>';
    }
    echo '</table>';


    n7seb@softhome. net (Scott Brown) wrote in message news:<161e6bb1. 0309131644.514d acd3@posting.go ogle.com>...[color=blue]
    > Hello,
    > I want to write a script that will display a table with a number of
    > rows the user wants. Example, I go to a page and need 30 rows, I press
    > submit and 30 rows are made.
    > I was thinking of a FOR EACH statement, but those examples are for
    > arrays.
    >
    > Any ideas?
    >
    > Scott n7seb@softhome. net[/color]

    Comment

    Working...