13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

300 Chapter 12 Advanced <strong>MySQL</strong> Administration<br />

ref: NULL<br />

rows: 4<br />

Extra:<br />

*************************** 2. row ***************************<br />

id: 1<br />

select_type: SIMPLE<br />

table: order_items<br />

type: ref<br />

possible_keys: PRIMARY<br />

key: PRIMARY<br />

key_len: 4<br />

ref: books.orders.orderid<br />

rows: 1<br />

Extra: Using index<br />

*************************** 3. row ***************************<br />

id: 1<br />

select_type: SIMPLE<br />

table: customers<br />

type: ALL<br />

possible_keys: PRIMARY<br />

key: NULL<br />

key_len: NULL<br />

ref: NULL<br />

rows: 3<br />

Extra: Using where; Using join buffer<br />

*************************** 4. row ***************************<br />

id: 1<br />

select_type: SIMPLE<br />

table: books<br />

type: eq_ref<br />

possible_keys: PRIMARY<br />

key: PRIMARY<br />

key_len: 13<br />

ref: books.order_items.isbn<br />

rows: 1<br />

Extra: Using where<br />

This output might look confusing at first, but it can be very useful. Let’s look at the<br />

columns in this table one by one.<br />

The first column, id, gives the ID number of the SELECT statement within the query<br />

that this row refers to.<br />

The column select_type explains the type of query being used.The set of values<br />

this column can have is shown in Table 12.8.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!