If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Help!! Dropdown to Textarea via MySql

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-21-04, 04:33
edgarsr edgarsr is offline
Registered User
 
Join Date: Oct 2004
Location: KY
Posts: 2
Help!! Dropdown to Textarea via MySql

Hopefully someone here can help me... I am drawing a complete blank and feel like an idiot but here goes....

I am trying to get a drowdown box populated by field b of table A to OnSelect display field b of table B in a textbox below (note: field a of both is id) underneath

the text box it would have update to effect changes if necessary (this part if optional - probably better to have it updated on an admin screen.) Anyway im

stuck...got the javascript/php/mysql to popluate to the dropdown no probably then drew a blank.

I have tried countless way to effect the proper result. Still having trouble. Below is the latest code tried.

Thanks for you help.

<html>

<head>
<title></title>
</head>

<body>
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr valign="bottom">
<td width="50%" align="right">
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<form name="testing" method="GET" action="<?=$PHP_SELF?>">
Filter by
<select name="testing">
<?php
require("hits.php");
require ("db.php");
$result = mysql_query("SELECT * FROM title ORDER BY id");
$query = "SELECT * FROM title ORDER BY id ASC";
function displayerror($message) {
printf("<span class=\"formerror\">%s</span>\n", $message);
}
if (!($result = mysql_query($query))) {
displayerror(sprintf("Internal ****ed up error %d:%s\n", mysql_errno(), mysql_error()));
exit();
} // end if
if($result) {
while($row=mysql_fetch_array($result)){
?>
<option value="<? echo $row['id']; ?>"><? echo $row['title']." ".$row[''];?></option>
<?
} // end while
} // end if
?>
</select> <p>&nbsp;
<textarea name="n" cols="60" rows="10" ><?php echo $row ?></textarea>



</body>

</html>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On