0

i have made a guestbook kind of a program where a click on a button goes to a javascript function and then loads the content generated by a php file linked with a database. it works fine in google chrome but when i open IE9 and i click on the button it works normally but if i insert into the database any data and then press the button it shows me the old data only and not the new one. same if done with chrome it shows me the entire data including the new and the old ones..... here are my codes.


the button

<button class="btn" onclick="extrct()">Refresh</button>

the function

function extrct()
{
$("#book").load("extract.php");
}

the php file

    <?php
$con=mysql_connect("localhost","root","#death123#","");
date_default_timezone_set('Asia/Kolkata');
$y="guestbookdb_".date('Y');
$db=mysql_select_db("$y",$con);
$m="guestbooktb_".date('M');
$d=date('Y').":".date('m').":".date('d');
$result="SELECT * FROM $m WHERE date='$d' ORDER BY time DESC";
if(!$ftq=mysql_query($result,$con))
    echo mysql_errno($con);
while($row = mysql_fetch_array($ftq))
    {
    $c=$row['comment'];
    $dt=$row['date']."  ".$row['time'];
    $name=$row['empid'];
    echo '<p style="width:70%;background-color:#7ec0ee;color:black ">'.$c.'</p>';
    echo '<nav><ul style="list-style-type:none;"><li style="width:35%;float:left;background-color:#ffb90f;color:black ">'.$name.'</li><li style="width:35%;float:left;background-color:#daa520;color:black ">'.$dt.'</li></ul></nav><br><br>';
    }
?>

0 Answers0