Click to See Complete Forum and Search --> : Help With Design


dfd2000
03-03-2005, 03:21 PM
Hello forum
I need your help I have this:
<?php
mysql_data_seek($title_query, 0);

while ($title_result=mysql_fetch_array($title_query)){
$numJobs = mysql_result(mysql_query("SELECT COUNT(*) FROM job_post WHERE JobCategory='{$title_result['jobcategory']}'"), 0);
echo "";
echo "<br><a href=\"jobseekers/job-search2.php?JobCategory={$title_result['jobcategory']}\">{$title_result['jobcategory']} ($numJobs)</a>";
echo " ";
}

mysql_data_seek($title_query, 0)
?>

and result is this:

For ex.
Automative
Engineering
Hardware
Software



My question is how to make changes/design to have result in 2
Like this:
For ex.
Automative Hardware
Engineering Software

NogDog
03-03-2005, 03:48 PM
<?php
mysql_data_seek($title_query, 0);
$counter = 0; # track number of links displayed
while ($title_result=mysql_fetch_array($title_query)){
$numJobs = mysql_result(mysql_query("SELECT COUNT(*) FROM job_post WHERE JobCategory='{$title_result['jobcategory']}'"), 0);
# echo ""; (this does nothing)
$br = ($counter++ % 2 == 0) ? "<br>" : ""; # if divisble by 2 use <br>
echo "$br<a href=\"jobseekers/job-search2.php?JobCategory={$title_result['jobcategory']}\">{$title_result['jobcategory']} ($numJobs)</a>\n";
# echo " "; (adding linefeed to end of previous line makes this unnecessary
}

mysql_data_seek($title_query, 0)
?>

dfd2000
03-03-2005, 03:55 PM
WOW FAST RESPONS
Thanx is greate,is look wonderful

dfd2000
03-04-2005, 03:15 AM
for Pittimann

Pittimann
03-04-2005, 05:22 AM
Hi!

In reply to your pm's:

wouldn't it be easier, to use something like my brother suggested here (http://www.webdeveloper.com/forum/showthread.php?s=&postid=296791#post296791)? Of course it would be possible to bake a cookie, but I think, my brother's suggestion is ok.

Cheers - Pit