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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.