Temporary Table Problem - Help
Hi, I'm running mysql version 4.0.13 and trying to create a temporary table from a php script. For some reason, even though I have the permission set up correctly, I can't seem to create a temporary table from the script. The permission say that create_tmp_table_priv=Y for the user in my connection code below. I have no problem creating the temp table with the same sql syntax directly in the mysql command interface and no problem creating a regular table using php? The sql I'm trying to execute is in the following code" $dblink= mysql_connect('localhost','pi', 'plant') or die ("Problem with My SQL connection.\n") ; mysql_select_db('plant_inventory') or die ("Problem with connection to the database: plant_inventory.\n"); $sql = "CREATE temporary TABLE tmpInventory "; $sql .= " SELECT * FROM inventory WHERE 1=0;"; $create_tmp = mysql_query($sql) or $err=("temp table not created"); Any ideas why this might be happening? Anya Miretsky Computer Technology Dept. Brooklyn Botanic Garden 1000 Washington Avenue Brooklyn, NY 11225 (718)623-7265 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Temporary Table Problem - Help
I am ausuming you are using the same user from both PHP and the mysql client. But are you doing both locally? There may be two user records, one for localhost and one for remote connections (or something to that effect). Just a thought. -Jackson On Monday 11 August 2003 1:52, Miretsky, Anya wrote: > Hi, > > I'm running mysql version 4.0.13 and trying to create a temporary table > from a php script. For some reason, even though I have the permission > set up correctly, I can't seem to create a temporary table from the > script. The permission say that create_tmp_table_priv=Y for the user in > my connection code below. I have no problem creating the temp table with > the same sql syntax directly in the mysql command interface and no > problem creating a regular table using php? > > The sql I'm trying to execute is in the following code" > > $dblink= mysql_connect('localhost','pi', 'plant') or die ("Problem > with My SQL connection.\n") ; > mysql_select_db('plant_inventory') or die ("Problem with connection > to the database: plant_inventory.\n"); > > $sql = "CREATE temporary TABLE tmpInventory "; > $sql .= " SELECT * FROM inventory WHERE 1=0;"; > $create_tmp = mysql_query($sql) or $err=("temp table not created"); > > > Any ideas why this might be happening? > > > > Anya Miretsky > Computer Technology Dept. > Brooklyn Botanic Garden > 1000 Washington Avenue > Brooklyn, NY 11225 > > (718)623-7265 > [EMAIL PROTECTED] -- jackson miller cold feet creative 615.321.3300 / 800.595.4401 [EMAIL PROTECTED] cold feet presents Emma the world's easiest email marketing Learn more @ http://www.myemma.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Temporary Table Problem - Help
"Miretsky, Anya" <[EMAIL PROTECTED]> wrote: > > I'm running mysql version 4.0.13 and trying to create a temporary table > from a php script. For some reason, even though I have the permission > set up correctly, I can't seem to create a temporary table from the > script. The permission say that create_tmp_table_priv=Y for the user in > my connection code below. I have no problem creating the temp table with > the same sql syntax directly in the mysql command interface and no > problem creating a regular table using php? > > The sql I'm trying to execute is in the following code" > > $dblink= mysql_connect('localhost','pi', 'plant') or die ("Problem > with My SQL connection.\n") ; > mysql_select_db('plant_inventory') or die ("Problem with connection > to the database: plant_inventory.\n"); > > $sql = "CREATE temporary TABLE tmpInventory "; > $sql .= " SELECT * FROM inventory WHERE 1=0;"; > $create_tmp = mysql_query($sql) or $err=("temp table not created"); > > > Any ideas why this might be happening? Use mysql_error() function to see error message. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]