Jump to content

PHP MYSQL query, Can this be formatted better


sunnysidesounds

Recommended Posts

Hey guys,

 

I know this is more of a MYSQL question then a php question. But I do feel like both go hand in hand. I just wanted some input as to how I could improve the performance of this query:

 

$query = 'SELECT '.PROJECT_TABLE.'.uid, '.PROJECT_TABLE.'.title, '.PROJECT_TABLE.'.description, '.USER_TABLE.'.proj_id FROM '.PROJECT_TABLE.', '.USER_TABLE.' WHERE '.PROJECT_TABLE.'.title LIKE "%'.$searchProjectNoTags.'%" OR last_name LIKE "%'.$searchProjectNoTags.'%" AND '.USER_TABLE.'.proj_id = '.PROJECT_TABLE.'.uid GROUP BY title LIMIT ' . $startLimit . ', ' . $displayPerPage. '';

 

This is basically a simple search form that searches in two tables. Project Table and User Table.

 

Thanks in advance

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.