> Bob,
> Thank you for mentioning the quick order screen. That was one I had not
> tried yet.
>
> When I tried to run the quick order screen, I received a 0 is not a mysql
> result error. So I printed out the query and ran it through
> phpmyadmin and
> this is the error message I got:
>
> MySQL said: The table 'SQLea60_0' is full
>
> I assume that this points more strongly to mysql.
>
> Also, I have experienced timeouts in phpmyadmin for simple select queries
> like "Select ID from department where Parent = [number]".
>
> Thank you all for your help. I guess it is time to contact the ISP.
OK, I can tell you exactly what's happening. When MySQL complains about
strangely-named table being full, it's talking about an in-memory temporary
table. This means you have a join going on that requires too much space
to perform in memory. You can set how much memory is available for temp
tables, but only if you're root, of course. The way to get around this in
your app is to tell MySQL to use the disk for temp tables. You'll only want
this to happen for the queries where you absolutely need it, though, since
it
is slower. Here's the code you need:
/*
** The main query can get really big, so we need
** to use the disk for temp space
*/
$Query = "SET OPTION SQL_BIG_TABLES=1";
$DatabaseResult = mysql_query($Query, $DatabaseLink);
//put your big query in here
/*
** Go back to using memory for temp tables
*/
$Query = "SET OPTION SQL_BIG_TABLES=0";
$DatabaseResult = mysql_query($Query, $DatabaseLink);
On the subject of indexes...yes, FreeTrade 1.x doesn't have all the indexes
it needs, and adding some might get rid of this problem. There is a way to
have MySQL analyze a query and tell you which indexes it's using, so you
could
go about optimizing things that way, but I found it to be very tedious.
I have gone through the FreeTrade 2 schema and added lots of indexes and
foriegn keys, but the schema has changed enough that it's not usable by the
older code. If someone wants to volunteer to go through the FreeTrade 1.x
schema and add indexes, I'll commit it.
Leon
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Site: http://www.working-dogs.com/freetrade/
Problems?: [EMAIL PROTECTED]