I have a listbox, and if you click on one value"say XXX" in it then it will display( select * from table where value='xxx')
I tired but i am getting an error
<span style="color: rgb(0, 0, 0);">
PHP Code:
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body>
<form id="form1" name="form1" method="get" action="<? echo $PHP_SELF; ?> "> <?php $host = "localhost"; $user = $pass = $dbname = $connection = mysql_connect("localhost", "root", "") or die("Cannot connect to MySQL server: " .
mysql_error()); $db_selected = mysql_select_db(' ' , $connection); $query ="select CELLID from comments"; $result=mysql_query($query);
echo "<select name='CELLID'>\n"; while($row=mysql_fetch_assoc($result)){ echo "<option value=\"$row[CELLID]\">$row[CELLID]</option>\n"; } echo "</select>"; ?> <input type="submit" name="Submit" value="Select" /> </form> <hr> <p> <?
if (isset($_GET['submit'])){
$result=mysql_query("select problem, solution from comments where id='$select'");
while($row_list=mysql_fetch_assoc($result){ echo $row['problem'];
// End if statement. }
// Close database connection. mysql_close(); ?> </p> </body> </html>
It gets the cellids from the table but on submit it does not display the related data on the bottom of the page.
Please help
|