All,

I'm trying to write a page in PHP that will list all the values in a given
table when it is selected.

Is there an easy way of doing this?

The code I'm using at the moment is below.  This selects the correct table,
but will not echo the values.  Any help is much appreciated...

TIA,

Matt

=.=.=.=.=.=.=.=.=.=.=.=.=.=.=

<?include("library/database.php");?>
<form action="test.php" method="post">
<?
echo "<select name=\"tablename\">";
$result = mysql_list_tables(interact);
    
    if (!$result) {
        print "DB Error, could not list tables\n";
        print 'MySQL Error: ' . mysql_error();
        exit;
    }
    
    while ($row = mysql_fetch_row($result)) {
        print "<option value=\"$row[0]\">$row[0]</option>\n";
    }

    mysql_free_result($result);
echo "</select><input type=\"submit\" value=\"Select\">";
?>
</form>
<?php
if($tablename!="")
{
$result = mysql_query("SELECT * FROM $tablename",$db);
$i=0;
while ($myrow = mysql_fetch_row($result)) {
echo $myrow[i];
echo $i;
$i++;
}
}
?>

____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:wdvltalk-join@;lists.wdvl.com 
       Send Your Posts To: [EMAIL PROTECTED]
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to