...

View Full Version : Subtracting from SELECT Count(*) strings



Midd_Knight
10-02-2004, 04:18 AM
I'm trying to get php to subtract the output from a query count string. I've tried many various ways. And out of options, could anyone point me in the right direction? A guide.. or advice perhaps.

I'm trying to subtract by 2, from the IPBoard members.

code;


<?php
mysql_connect("localhost","UUUUUUUU","PPPPPPP");
mysql_select_db("DB_NAME");
$query = "SELECT COUNT(*) AS numrows FROM ibf_members";
$nummembers = mysql_query($query) or die("Select Failed!");
$nummembers = mysql_fetch_array($nummembers);
?>
Members: <? echo $nummembers[0]; ?>

Thanks for any help!

Dylan Leblanc
10-02-2004, 04:35 AM
SELECT COUNT(*) - 2 AS numrows FROM ibf_members



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum