I am wondering if any one knows how I might use a form to take selected data from one table and then place it into another. I want form to enable me to view all my tables in mysql dba so that I can select one to put data into does anyone know how i might do this. The only code I have thus far is a function which gets the data from the table I am transfering from. I have also the form I am using below as well
function getFileName(){
Global $connection;
hookUpDb();
$query = "SELECT id,header
FROM content
ORDER BY header DESC";
$result = mysql_query($query,$connection);
while ($row = mysql_fetch_row($result)){
$id = $row[0];
$header = unFormatData($row[1]);
print("<option value=\"$id\">
$header</option>\n");
}
mysql_free_result($result);
mysql_close($connection);
}
<form action="admin.php" >
<table class="formBg" align="center" width="40%" border="1" cellspacing="0" cellpadding="2">
<tr valign="top">
<td width="43%">Choose File here</td>
<td width="57%">
<select class="dropdownMedium" name="selArticle">
<option selected value="0">--- Choose File here ---</option>
<?php getFileName(); ?>
</select>
<input class="medium" type="hidden" name="txtId" value="<?php print(unFormatData($row[0])); ?>">
</td>
</tr>
<tr valign="top">
<td width="43%">Choose Table here</td>
<td width="57%">
<select class="dropdownMedium" name="selArticle">
<option selected value="0">--- Choose Table here ---</option>
<?php getTableName(); ?>
</select>
<input class="medium" type="hidden" name="txtId" value="<?php print(unFormatData($row[1])); ?>">
</td>
</tr>
<tr valign="top">
<td width="43%"> </td>
<td width="57%">
<input class="button" type="submit" name="submit" value="Submit">
<input class="button" type="reset" name="reset" value="Reset">
</td>
</tr>
</table>
</form>