i have written a page which consists of a frameset and two pages included. you can enter a clients details in the top one and then you select the company they work for from a provided list, wich is populated by the following php script from MySQL

$sql = "SELECT companyname FROM companies ORDER BY companyname ASC";
$sql_result = mysql_query("$sql", $db) 
or die("Unable to execute query:<br>$sql<br>Error: " . mysql_error()); 
while ($row = mysql_fetch_array($sql_result)) {
$companies  = $row["companyname"];
$option_block .= "<OPTION value=\"$companies\">$companies</OPTION>";
}

Does anyone know if there is a way I can get this to update say every 20 seconds so the combo box shows the latest addition without a refresh.

Cheers 🙂

    output the html meta-tag of refresh or javascript to achieve this.

    <edit>
    had made a few typo err's a min ago.

      Yeah, it turned out to be the only way, I was hoping to make it more interative but at least it's nice and standard.

      Thanks for your help.

        you can make it more seemless by adding a thrid frame.

        the third frame will be almost invisible (make it 1 pixel in width or height -- however you layout is).

        that frame will reload every 20 seconds.

        if there is a change/addition, it will use javascript to repopulate the items in the frame with the popup menu.

        it might be tricky to do, but it will seem seemless since the user won't see the page flicker when refreshing/updating.

        but if time is a constraint and you really don't want to put in that extra work, then go with meta refresh on the popup menu frame :-)

        -sridhar

          but could anyone give a sample code to make it refresh automatically?

            Using javascript

            <script>
            function reloadpage() {
            document.location.href=location.href;
            }

            setTimeout(10000,"reloadpage();");

            </script>

            Using HTML meta tag:

            //for going to some other page
            <META HTTP-EQUIV="Refresh" CONTENT="3;URL=http://www.some.org/some.html">

            //for refreshing the current page
            <META HTTP-EQUIV="Refresh" CONTENT="3">

              Write a Reply...