Jump to content

Can this be shortend or put in a function?


brown2005

Recommended Posts

$a = "SELECT COUNT(*) AS num FROM a;";
$a_query = mysql_query($a) or die(mysql_error());

while($a_array = mysql_fetch_array($a_query))
{

echo"$a_array[num]";
 
}

echo"<br><br><br>";

$b = "SELECT COUNT(*) AS num1 FROM a WHERE a_30days='1';";
$b_query = mysql_query($b) or die(mysql_error());

while($b_array = mysql_fetch_array($b_query))
{

echo"$b_array[num1]";
 
}

can the above to be shortend at all or put into a function to make them easier/faster to work?

Archived

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

×
×
  • Create New...

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.