>not show after the user press the reload button. Is there a way that the
page reaload >automatically the data from the database without the user
pressing the reload button? Thanks
Not really -- You can send no-cache and expiration headers, so they'll
*HAVE* to reload to see anything at all, but it won't auto-reload.
Another option:
Have the page POST to itself, and re-generate the new list after the INSERT.
Here's a crude example:
<?php
if (isset($newcat)){
$query = "insert into categories(name) values('$newcat')";
mysql_query($query) or die("Could not execute $query");
}
$query = "select id, name from categories order by name";
$cats = mysql_query($query) or die("Could not execute $query");
echo "<FORM ACTION=$PHP_SELF METHOD=POST>\n";
echo "<SELECT>\n";
while (list($id, $name) = mysql_fetch_row($cats)){
echo "<OPTION VALUE=$id>$name</OPTION>\n";
}
echo "</SELECT><BR>\n";
echo "<INPUT NAME=newcat><BR>\n";
echo "<INPUT TYPE=SUBMIT>\n";
echo "<FORM>\n";
?>
Since the INSERT happens at the top, the new entry will always show up as he
goes.
--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]