Jump to content

Archived

This topic is now archived and is closed to further replies.

joecooper

Get total row number?

Recommended Posts

[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]

Share this post


Link to post
Share on other sites
[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".

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.