Jump to content

[SOLVED] New select and mysql error


pcw

Recommended Posts

Hi, I have written this script to select a database to backup

 

<?php

include("data/required.php");

if (!mysql_connect($dbhost, $dbuser, $dbpass)) {
    echo 'Could not connect to mysql';
    exit;
}

$showtablequery = "
SHOW TABLES
FROM
$db
";

$showtablequery_result	= mysql_query($showtablequery);
while($showtablerow = mysql_fetch_array($showtablequery_result))
{
$table = $showtablerow[0]."<br />";


print "<form action='sqlexport.php?cmd=sqlbackup' method='POST'>";
print "<select name='backupFile'>";
print "<option>Backup Database</option>";

print sprintf("<option value='$table/%s'>%s</option>", $table, $table);

print "</select>";
print "<input type='submit' name='tmpupdate' value='update'>";
print "</form>";
print "</center>";

print '
</td>
        </tr>
      </table>';
      }	
?>

 

However it prints a select menu for each table. I want to be able to select the table from one select menu. What do I need to change?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/150341-solved-new-select-and-mysql-error/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.