Jump to content

Fill inputbox with comment from selected question


I-R-Fool

Recommended Posts

Ok, so i'm working on an admin cpNow..I have this message editor, created it myself, but its not working 100%Okay, so i filled a select box with sql data, now i need it to fill the input field with $row['comment']but the comment has to be comment at the selected question.heres my sql query

$con = mysql_connect("localhost","*****","******");if (!$con)  {  die('Could not connect: ' . mysql_error());  }  mysql_select_db("a", $con);$query = " SELECT * FROM a " .		 "ORDER BY id DESC";$result = mysql_query($query) or die('Error, query failed');echo("<form><select name='select' value='a' size='auto')>");while($row = mysql_fetch_array($result)){$question = $row['question'];$rowid = $row['id'];echo "<option name='a'>".$row['question']."</option>";$comment = $row['comment'];}echo("</select><br />");echo("<br /><input type='text' name='hai' value=".$comment."></input></form>");mysql_close($con);

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...