I have experience in PHP coding but am very NEW to this PHPMYEDIT ... I think this is a great system once I learn it more in deep.
I am having troubles making a code work that has a drop down menu for selecting a particular table from a DATABASE.
The database will have many tables in it ALL with the same exact coloumn/data structure .. and they are fetched by this code i have written :
| Kód: |
$i = 0;
$sql = "SHOW TABLES FROM $database";
$Tables = mysql_query($sql);
echo ' <form action="' ,$_SERVER['PHP_SELF'], '" method="post">';
echo ' Select Table : <SELECT NAME="table_select">';
while ($i < mysql_num_rows ($Tables)) {
$tb_names[$i] = mysql_tablename ($Tables, $i);
echo '<OPTION VALUE=' .$tb_names[$i]. '>' .$tb_names[$i]. '</option>';
$i++;
}
echo ' </SELECT>
<input type="submit" name="table_submit" value="Submit" />
</form>';
|
that puts a DROP DOWN menu on top of the list.. when you select a specific table from the drop down menu... the PHPMYEDIT DOES indeed pull up the correct table and displays it PROPERLy under the drop down menu.. where it shows the list of the table contents and is ready to edit... so i know THAT WORKS!!!
but when i hit to ADD or CHANGE a field that it doesnt do anything but goes to blank page!
This is the code that I have that makes it select the right table from the database and turns the variable for the table name to the $opts['tb'].. thats how it knows to display the table seclected from the drop down menu.
| Kód: |
if (isset($_POST['table_submit']))
{
$dbTable = $_POST['table_select'];
echo '<B>Name of Table: ' . $dbTable. '</B>';
$opts['tb'] = $dbTable;
snip.... rest of stock phpmyedit code.....
}
|
So everything seems to work the way i want with the drop down table selector on top.. and having it show the correct table for editing.. but then i cant change or add anything to it!
Thank you in advance for the help!
Cheerz
Justin
|