Could anybody please help:

In the query I have included a limit string which allows me to display
individual records page by page. The limit string variable is
incremented/decremented using hyperlinks. I feel it would be better if I
could somehow manually step through the returned
$query_data = mysql_fetch_array($result). Is it possible to create a loop
with a counter to step through the records contained in the array?

// PHP Code
$link_id = db_connect($default_dbname) ;
 if(!$link_id) error_message(sql_error()) ;
$query = "select count(*) from $user_tablename" ;
$result = mysql_query($query) ;
    if(!$result) error_message(sql_error()) ;
$query_data = mysql_fetch_row($result) ;
$total_num_user = $query_data[0] ;
if(!$total_num_user) error_message('No records found!') ;

$query = "select usernumber, userid, userpassword, username, sex,
nationality, usermail, userprofile, registerdate, date_format(registerdate,
'%M, %e, %Y') as formatted_registerdate, lastaccesstime,
date_format(lastaccesstime, '%M, %e, %Y') as formatted_lastaccesstime from
$user_tablename $order_by_str $sort_order_str $limit_str" ;

$result = mysql_query($query) ;
if(!$result) error_message(sql_error()) ;

$query_data  = mysql_fetch_array($result) ;
// Table displaying the found records from MySQL database
    
Thanx

Gavin

Reply via email to