我想将2个数据库与2个while循环组合在一起。代码如下。
public class DefaultPrinter
{
[DllImport("winspool.drv", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool SetDefaultPrinter(string Name);
}
DefaultPrinter.SetDefaultPrinter("WH");
答案 0 :(得分:0)
第一条评论:使用PDO或MySQLI
但要让您当前的代码正常工作:
$query1 = mysql_query("SELECT `a_id`,`a_name` FROM `photo_album`");
while ($run1 = mysql_fetch_array($query1)){
$album_id = $run1['id'];
$album_name = $run1['name'];
$query2 = mysql_query("SELECT `url` FROM `photo_gal` WHERE `album_id`='$album_id'");
while($run2=mysql_fetch_array($query2)){
$pic = $run2['url'];
}
}