Jump to content

order by grouping


flemingmike

Recommended Posts

this would help me also:

 

what is the propper way to write this:

 

$mechanic1 = mysql_query("SELECT * FROM staff ORDER BY name");
while($row44 = mysql_fetch_array($mechanic1))
{
$meid=$row44['eid'];
}

$result3 = mysql_query("SELECT * FROM timesheet WHERE date >= '$payperiodstart' AND date < '$payperiodend' ORDER BY '$meid' ");
while($row3 = mysql_fetch_array($result3))
{

 

reason being is that inside timesheets, i have an employeeid field (eid).  im hoping that with result3 i can have it ordered by the mechanic name even though i dont have a field in timesheets for name.

Link to comment
https://forums.phpfreaks.com/topic/216333-order-by-grouping/#findComment-1124243
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.