Is this bad coding, ?
Posted: Sat Oct 25, 2003 6:03 pm
I am wondering if this will slow my web pages down if i have this included .
Is there a better more efficent way of doing this, or is this the quickest?
Is there a better more efficent way of doing this, or is this the quickest?
Code: Select all
<?php
<?php
$sqlhome = "select count(*) from id where cat = 'Home'";
$numhome=mysql_query($sqlhome,$db) or die("Select Failed");
$home = mysql_fetch_array($numhome);
//get count of all family
$sqlfamily = "select count(*) from id where cat = 'Family' '";
$numfamily=mysql_query($sqlfamily,$db) or die("Select Failed");
$family = mysql_fetch_array($numfamily);
//get count of all of student
$sqlstudent = "select count(*) from id where cat = 'Student' ";
$numstudent=mysql_query($sqlstudent,$db) or die("Select Failed");
$student = mysql_fetch_array($numstudent);
//get count of all taxes
$sqlvehicle = "select count(*) from id where cat = 'taxes' ";
$numvehicle=mysql_query($sqlvehicle,$db) or die("Select Failed");
$vehicle = mysql_fetch_array($numvehicle);
//get count of all garden
$sqlgarden = "select count(*) from id where cat = 'Garden' ";
$numgarden=mysql_query($sqlgarden,$db) or die("Select Failed");
$garden = mysql_fetch_array($numgarden);
//get count of all the ids
$sqlall = "select count(*) from advert where valid='1'";
$numall=mysql_query($sqlall,$db) or die("Select Failed");
$all = mysql_fetch_array($numall);
//get count of all of for the events
$sqlevent = "select count(*) from event where type = 'Event' ";
$numevent=mysql_query($sqlevent,$db) or die("Select Failed");
$event = mysql_fetch_array($numevent);
//get count of all of for the announements
$sqlannounce = "select count(*) from event where type = 'Announcement' ";
$numannounce=mysql_query($sqlannounce,$db) or die("Select Failed");
$announce = mysql_fetch_array($numannounce);
//get count of all the jobs
$sqljob = "select count(*) from job";
$numjob=mysql_query($sqljob,$db) or die("Select Failed");
$jobs = mysql_fetch_array($numjob);
?>