Jump to content


Photo

MySQL Statement Explanation


  • Please log in to reply
No replies to this topic

#1 machnhed1

machnhed1
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 11 June 2003 - 03:24 PM

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!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users