Jump to content

Help with SQL_BIG_SELECTS=1


dgmuk

Recommended Posts

Hi,

 

I'm having a problem with mysql database in that I need to SET SQL_BIG_SELECTS=1 but I have no idea how to do it!  :(

 

This is the script I am using:

 

 

mysql_connect("localhost", "DATABASENAME", "PASSWORD") or die(mysql_error());

mysql_select_db("DATABASENAME") or die(mysql_error());

 

 

$result = mysql_query("SELECT * FROM table")

or die(mysql_error()); 

 

 

echo "<table border='1'>";

echo "<tr> <th>Name</th> <th>Age</th> </tr>";

// keeps getting the next row until there are no more to get

while($row = mysql_fetch_array( $result )) {

// Print out the contents of each row into a table

echo "<tr><td>";

echo $row['id'];

echo "</td><td>";

echo $row['name'];

echo "</td></tr>";

}

 

echo "</table>";

 

 

 

When I run the script I get the error:

 

The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay

 

 

Can anyone help please as I have searched everywhere and I can't find the answer!  ???

 

Thanks very much!

Link to comment
Share on other sites


mysql_connect("localhost", "USERNAME", "PASSWORD") or die(mysql_error());
mysql_select_db("DATABASENAME") or die(mysql_error());

 

www.php.net/mysql_connect

 

host, username, password. The database gets designated in the select_db portion.

Link to comment
Share on other sites

Hi guys,

 

Thanks for the info... i should have mentioned that I changed the databasename, password and table name to say databasename, password and table just for example on the forum!

 

Any ideas about how to SET SQL_BIG_SELECTS=1?

 

Thanks again!

Link to comment
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.