i create temporary table and check if criteria .
then insert value in the temporary table but i can not query and show data form my temporary table.
what wrong ?
<?
mysql_connect($host,$user,$passwd);
$sql1="create temporary table if not exists tpsbdss ( tfcid mediumint(5) zerofill not null, tuid varchar(4), tcid varchar(4), peng int, pcost int, pbg int, pgpa int, pgmat int, pclimate int, , totpt int, primary key (tfcid))";
$result1 = mysql_db_query($dbname,$sql1);
$sql = "select tp.tfcid, fc.fcid, fc.bgfield1, fc.gpa, fc.TOEFL, fc.TWE, fc.GMAT, fc.GMATrq, fc.wkexp, c.climate from fieldcourse as fc, tpsbdss as tp, field as f, city as c where fc.fcid=tp.tfcid and f.fid=fc.fid and c.cid=fc.cid";
$result = mysql_db_query($dbname, $sql);
while ($row=mysql_fetch_array($result)) {
$tfcid=$row["tfcid"]; $fcid = $row["fcid"];
($igpa >= $row["gpa"]) ? $rgpa = 8 : $rgpa=0;
$pgpa = $rgpa * 9;
($iclimate == $row["climate"]) ? $rclimate = 8: $rclimate=0;
$wclimate = 8;
$pclimate=$rclimate*$wclimate;
$totpt = $pclimate + $pgpa;
$sql5 = "insert into tpsbdss (pgpa,pclimate,totpt) values ('$pgpa','pclimate','$ptotp') where tfcid='$tfcid'";
$result5 = mysql_db_query($dbname,$sql5);
}
echo "<table>";
$sql1 = "select * from tpsbdss order by totpt desc";
$rs1=mysql_db_query($dbname,$rs1);
while ($row=mysql_fetch_array($rs1) {
$totpt = $row["totpt"];
$pgpa = $row["pgpa"];
$pclimate = $row["pclimate"];
echo "<tr><td>$totpt</td>><td>$pgpa</td>><td>$pclimate</td></tr>";
}
echo "</table>";
?>