help me with ym query pls...

this is my code…

$querys=mysql_query(“SELECT * FROM slotmaintenance WHERE fldspace=’$tmp_space’ GROUP BY fldcode ORDER BY fldname”,$conn);

‘.$mycount.’ Slot(s) ‘.$myfldname.’
Pos ‘.$tmp_space.’ Remarks Date Installed Size
‘.$myfldposition.’  ‘.$myfldsupplier.’  ‘.$myfldstatus.’  ‘.$myfldinstalled.’  ‘.$myfldsize.’ 

$mycount=$mycount + 1;
echo $mytbltitle;

here is the result

in my database

now this is what i want

  1. I would normalize the db:

put fldcode and fldname in a diffrent table and delete fldname from slotmaintenance. wounlt make a bigg difrence now but avoids errors in the future.

  1. u cannt use GROUP BY if u wanna have all results.

From there i know 2 ways to go on:

use a variable $oldfldcode and put the “

”-part inside an if($oldfldcode!=$myfldcode)

or use a first query and loop to just get the fldcode and fldname. and inside that loop use a second mysql_query and loop to get all rows WHERE fldcode=$myfldcode.

Sponsor our Newsletter | Privacy Policy | Terms of Service