Deviant Logo

PHP and Html page query?

post details top
Jun 7th, 2010
post details top


Hi,

below is the working code

$username = "test";
$password = "test123";
$database = "bugs";

mysql_connect("bug-reports.com", $username, $password);

@mysql_select_db($database) or die("unable to select database");

$query = "SELECT name from products";

$result = mysql_query($query);

while ( list($name) = mysql_fetch_row($result) )
{

echo "$name
” ;
}

?>

I want to populate name list into a combobox inside a html page , how to do that please help.

thanks in advance.

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

2 Comments

  • enthu

    < ?php
    $username = "test";
    $password = "test123";
    $database = "bugs";

    mysql_connect("bug-reports.com... $username, $password);

    @mysql_select_db($database) or die("unable to select database");

    $query = "SELECT name from products";

    $result = mysql_query($query);
    ?>

  • anubhav jain

    < ?php
    $username = "test";
    $password = "test123";
    $database = "bugs";

    mysql_connect("bug-reports.com... $username, $password);

    @mysql_select_db($database) or die("unable to select database");

    $query = "SELECT name from products";

    $result = mysql_query($query);

    echo "