Hello,

I have a select box which grabs table names as in the first snippit of
code.
I then have an INSERT statement which loads a text file I specifiy in a
text field into the selected table .
This executes on PHP_SELF submit.

If I replace '$t' with INTO TABLE MY_TABLE_HERE, I get an insert and the
table is populated as required without a hitch.
Replace  MY_TABLE_HERE with INTO TABLE '$t' and I get nothing.

Any suggestions on this one?

Thanks in advance,

Tony

--------- snip -----------------------

<select name="table">
<?
$result = mysql_list_tables ($DB);
$i = 0;
while ($i < mysql_num_rows ($result)) {
    $tb_names[$i] = mysql_tablename($result, $i);
    echo "<option value=" . strtoupper($tb_names[$i]) . ">" .
strtoupper($tb_names[$i]) . "</option>";
    $i++;
}
?>
</select>

----snippit 2 ------------------------

$p=trim(addslashes($path));
$t=trim($table);
if(!($result=mysql_db_query($DB, "LOAD DATA INFILE '$p' INTO TABLE '$t'
FIELDS TERMINATED BY '|' LINES TERMINATED BY ';'")))





-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to