Jump to content

order by name


kvnirvana

Recommended Posts

It's a little messy having the SQL within the function like that, separate it into a variable and you'll probably find it easier to work out the syntax in future. In this case, you just need to re-open the string after the variable and add the order by clause:

 

$sql = "SELECT * FROM company_people WHERE company_id = " . (int) $company_id . " order by name";
[...]

Link to comment
https://forums.phpfreaks.com/topic/229561-order-by-name/#findComment-1184477
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.