Jump to content

combine queries


xiao

Recommended Posts

I have this:

$query = "SELECT * FROM jobs WHERE (employer_id='".$rij['id']."' AND complete='0')";
$query = mysql_query($query) or die("Fout in query");
$act_jobs = mysql_num_rows($query);
$query = "SELECT * FROM jobs WHERE (employer_id='".$rij['id']."' AND complete='1')";
$query = mysql_query($query) or die("Fout in query");
$afg_jobs = mysql_num_rows($query);

 

The first variable contains the number Active jobs, the second one contains the number of Jobs that are closed.

Is there a way to shorten this? And maybe combine everything in 1 query?

Link to comment
https://forums.phpfreaks.com/topic/85549-combine-queries/
Share on other sites

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.