displaying number of entries

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
abbey4biz
Forum Commoner
Posts: 32
Joined: Wed Nov 23, 2011 12:25 pm

displaying number of entries

Post by abbey4biz »

Hi please, I am finding it difficult to display total number of vendors in my database. The code used are:

Code: Select all

<?php

require_once ('dbc.php');
$q = "SELECT count(id) as count FROM users";
$r = @mysqli_query ($dbc, $q);
$row = @mysql_fetch_array($r, MYSQLI_NUM);

?>
<font face="Tahoma" size="2" >Vendors online: <?php echo $row['count']; ?></font>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: displaying number of entries

Post by requinix »

You can't mix mysql with mysqli. Pick one to use and stick with it.
Post Reply