Simple Count Records from MySQL DB Table





-5
Date Submitted Thu. Mar. 1st, 2007 3:56 PM
Revision 1 of 1
Helper mjlintz
Tags PHP
Comments 4 comments
Get the count of records from DB

<?
$sql = "SELECT COUNT(*) AS count FROM table WHERE this = '$this'";
        $result = mysql_query($sql);
        while ($row = mysql_fetch_array($result))
        {
        $count = $row["count"];
        }

echo $count;

?>
 

Michael Lintz

Comments

Comments while()
Thu. Mar. 1st, 2007 4:18 PM    Helper Nico
Comments mmmmkay...
Sat. Mar. 3rd, 2007 12:11 AM    Helper Idlemind
Comments while? :)
Tue. May. 29th, 2007 3:48 AM    Helper morad
Comments Another way.
Tue. Mar. 6th, 2007 2:39 PM    Beginner wlasson

Voting