PHP, MySQL and temporary tables

Php newbie.

1.Is there something wrong with this PHP and MySQL code?

include_once "db_login.php" ;

$sql = "DROP TEMPORARY TABLE IF EXISTS temp_sap_id_select" ;
mysql_query ( $sql ) or ( "Error " . mysql_error () ) ;

$sql = " CREATE TEMPORARY TABLE temp_sap_id_select 
               (
                 `current_page` INT NOT NULL,
                 `total_pages` INT NOT NULL,
                 `select_date` DATE NOT NULL,
                 `select_schcode` CHAR(6) NOT NULL,
                 `select_user` CHAR(30) NOT NULL,
                 `select_id` CHAR(9) NOT NULL
               ) " ;
mysql_query ( $sql ) or ( "Error " . mysql_error () ) ;

      

2. Along the way, I'm a boring boy, but I'll ask anyway: if I use the MySQL GUI and open the target database, will it know about the previous temporary table created by PHP / MySQL (IF the temporary table was created correctly)?

+2


a source to share


1 answer


Temporary tables are visible only for the connection used to create them and disappear after the connection is closed.



+9


a source







All Articles