- 论坛徽章:
- 0
|
关于临时表创建的问题
我做成功了,但是在win2k+apache2.0.48+php4.3.4+mysql3.23.58-nt环境中.
<?php
$db = mysql_connect("localhost", "root", "root" ;
mysql_select_db("message",$db);
//建立临时表
$sqla = 'CREATE TEMPORARY TABLE `dwb_tmp` SELECT `dwdh`,`dwmc`,`ip_info` FROM `dwb` order by `dwdh`';
$resulta = mysql_query($sqla,$db);
//从临时表中查询并输出查询结果
$sqlb = 'select * from `dwb_tmp`';
$resultb = mysql_query($sqlb,$db);
while ( $myrow = mysql_fetch_array($resultb) ){
printf("%s %s %s", $myrow[dwdh],$myrow[dwmc],$myrow[ip_info]);
echo "<br>;";
}
?>; |
|