Jump to content

Explain Query


ueon

Recommended Posts

query selects every field from table a.. which is what a.* means

the fields Username,EmailAddress,UserID from table b..

now the programmer aliases table status to be "a" and users to be "b", for a shorter query..

the tables are joined on the condition that the email field from the "status" table equals the Emailaddress field from table "users"

now the main query has a WHERE clause here it will grab rows where the value from field "email" from table "status" is in the array $searchuser..

it orders the results by id descending..

Link to comment
https://forums.phpfreaks.com/topic/247047-explain-query/#findComment-1268733
Share on other sites

the ON is used in JOIN queries... and specifies how the two queries are joined, what the conditions need to be in order for the tables to join.. IN is a MYSQL function that searches an array of values for the specified value... documentation and examples can be found at these two links

 

http://dev.mysql.com/doc/refman/5.0/en/join.html

 

http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_in

Link to comment
https://forums.phpfreaks.com/topic/247047-explain-query/#findComment-1268789
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.