SQL EXPLAIN DON't WORK

batman1

New Member
Messages
92
Reaction score
0
Points
0
I am trying to OPTIMIZE my sql queries.

I am having a problem. The EXPLIAN query don't print any thing onto the screen. How does this statement wotk? Is it ENABLED?

See example:

Code:
	$result = mysql_query("EXPLAIN SELECT * FROM buxscript_members WHERE username = '$uname' OR username = '$ref' OR email = '$email' OR alertpay = '$ap' OR paypal = '$pp' OR register_email = '$email' OR register_alertpay = '$ap' OR register_paypal = '$pp' OR register_ip = '$user_ip'");
	while($row = mysql_fetch_array($result))
	{
		// Referral exists
		if($row["username"]==$ref && strlen($ref)>2)
			$ref_check = true;
		else
		{
			if($row["username"]==$uname){
				// username already exists
				$error = "Username already registered.";
				break;
			}
		}
	}
 

freecrm

New Member
Messages
629
Reaction score
0
Points
0
I can't see anything wrong with the syntax, but I don't see any output code!

As far as I understand, the query builds a recordset in much same way as a standard mysql_query but returns only one $row.

How are you outputting? These are the fields within the array to source.

id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
explain doesn't output information about the table anyways.

It's a synonym for DESCRIBE, which just explains how the query is executed.
 
Top