Hello
Temporary table is not being deleted once the connection is closed. I am not sure if the code is used correctly. Because when I run the code it just says table not found. SO, i had to create a table manually and then it worked.
Thank you
<?php
$hostname = "localhost";
$username = "1104107";
$password = "r940c1";
$database = "db1104107";
//echo '24';
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password);
$db = mysql_select_db($database, $dbhandle)
or die("Unable to connect to MySQL");
//echo "Connected to MySQL<br>";
$query_createTemporaryTable = "CREATE TEMPORARY TABLE #temp(temp_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
ArtistName VARCHAR(20), NAMEOfTheDVD VARCHAR(30)";
$result_createtemptable = mysql_query($query_createTemporaryTable ,$dbhandle );
$query_insertintotable = "INSERT INTO temp (ArtistName, NAMEOfTheDVD) VALUES ('R', 'SHAWooSHANK')";
$result_insertintotable = mysql_query($query_insertintotable ,$dbhandle) or die(mysql_error());
$query_selecttemptable = "SELECT ArtistName,NAMEOfTheDVD FROM temp";
$result_selecttemptable = mysql_query( $query_selecttemptable,$dbhandle) or die(mysql_error());
while($row_selecttemptable = mysql_fetch_array($result_selecttemptable)){
echo $row_selecttemptable;
}
mysql_close();
?>