Jump to content

Recommended Posts

Hi,

 

Apparently I am not up on my MySQL because I can\'t figure out how this statement works. After a day of tinkering I have a vague idea of what it does, but when I go to modify it I almost always end up getting an SQL error. I was hoping someone could do a line by line explanation of how this sucker is processed.

 

	$search_query_count = "select count(*) from $sql_tbl[products], $sql_tbl[pricing], $sql_tbl[categories] where $sql_tbl[pricing].productid=$sql_tbl[products].productid and $sql_tbl[pricing].quantity=1 and $sql_tbl[products].categoryid=$sql_tbl[categories].categoryid $membership_condition and ($sql_tbl[pricing].membership=\'". $user_account[\'membership\']."\' or $sql_tbl[pricing].membership=\'\') and ($sql_tbl[products].product like \'%$substring%\' or $sql_tbl[products].descr like \'%$substring%\') and $sql_tbl[categories].category like \'$search_category%\' and $sql_tbl[products].forsale=\'Y\' and $sql_tbl[categories].avail=\'Y\' $price_condition group by $sql_tbl[products].productid";

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/576-mysql-statement-explanation/
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.