Hey, im trying to do an insert in my app, but i need to create something to the user choose where he wants(table) to insert the data. To do that i’ve made a select box to select the table, but now i want to show the fields and insert the data into the selected one.
Help me please, i know its hard to understand but its urgent!
Thanks.
<html>
<head>
<title>Products</title>
</head>
<body>
<html>
<head>
<style>
ul {
</style>
</head>
<body>
</body>
</html>
<br>
<br>
<?php
$mydbname = 'visteon';
$conn=mysqli_connect('127.0.0.1','root','','visteon');
if(mysqli_connect_error($conn))
{
echo 'Failed to connect';
}
$options = '';
$result = mysqli_query($conn,"SHOW TABLES");
$column_name ='Tables_in_'.$mydbname;
while($row = mysqli_fetch_array($result))
$options .= '<option value="' . $row[$column_name] . '">' .
$row[$column_name] . '</option>';
echo '<select name="users" onchange="showTables(this.value)">';
echo '<option value="0">Select a table:</option>';
echo $options;
echo '</select>';
?>
<br>
<form method="post" action="processprodutos.php">
<label>Tipo</label>
<input type="text" name="Tipo">
<br>
<label>Quantidade</label>
<input type="text" name="Quantidade">
<br>
<label>Linha</label>
<input type="text" name="Linha">
<br>
<input type="submit" value="Adicionar">
</form>
</body>
</html>