Header("Content-type: image/jpeg");
$DBhost = "localhost";
$DBuser = "root";
$DBpass = "";
$DBName = "cinema";
$table = "film";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Impossibile collegarsi al server");
@mysql_select_db("$DBName") or die("Impossibile connettersi al database $DBName");
$sql = "SELECT copertina FROM film";
$result = @mysql_query($sql) or die (mysql_error());
while ($row = @mysql_fetch_array($result))
{
echo $row[0];
}
$DBhost = "localhost";
$DBuser = "root";
$DBpass = "";
$DBName = "cinema";
$table = "filmorario";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Impossibile collegarsi al server");
@mysql_select_db("$DBName") or die("Impossibile connettersi al database $DBName");
$sqltwo = "SELECT id_orario FROM filmorario WHERE id_film=1";
$resulttwo = @mysql_query($sqltwo) or die (mysql_error());
while ($rowtwo = @mysql_fetch_array($resulttwo))
{
echo $rowtwo[0];
}
爲什麼一次只出現一個查詢,如果我刪除第一個出現第二個,如果我刪除第二個出現第一個。我剛剛圖片出現與BLOB Mysql
這是 「電影」 的數據庫:
這是filmorario的數據庫:
我必須在要插入圖片id_orario。
您不需要再次在同一個文件中連接DB,也可以使用mysql_close()來關閉連接。 – hmjha