joecooper Posted March 28, 2006 Share Posted March 28, 2006 [code]<?php$sql="SELECT * FROM Test WHERE testid='$editid'";$query=mysql_query($sql);$row=mysql_fetch_array($query);?>[/code]how do i have $total as the total amount of rows in the database[b]EDIT BY OBER: PLEASE USE CODE TAGS TO POST CODE.[/b] Quote Link to comment https://forums.phpfreaks.com/topic/6012-get-total-row-number/ Share on other sites More sharing options...
ober Posted March 28, 2006 Share Posted March 28, 2006 [code]<?php$total = mysql_num_rows($query);?>[/code]As a side note, your naming is confusing. Your "query" is actually a "result". Your "sql" is actually the "query". Quote Link to comment https://forums.phpfreaks.com/topic/6012-get-total-row-number/#findComment-21591 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.