开发者

PHP, MySQL, and temporary tables

开发者 https://www.devze.com 2022-12-27 04:27 出处:网络
Php novice. 1.Is there anything wrong with this PHP & MySQL code? include_once \"db_login.php\" ; $sql = \"DROP TEMPORARY TABLE IF EXISTS temp_sap_id_select\" ;

Php novice.

1.Is there anything wrong with this PHP & 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.Admittedly, I'm a dull boy, but I'll ask anyway: If I'm using a MySQL GUI and have open the target database, will it be aware of the above 开发者_运维百科temporary table created by PHP/MySQL (IF the temporary table is properly created)?


Temporary tables are only visible to the connection used to create them, and they disappear once the connection is closed.

0

精彩评论

暂无评论...
验证码 换一张
取 消