[> Replace  MY_TABLE_HERE with INTO TABLE '$t' and I get nothing.]


Try ->   MY_TABLE_HERE with INTO TABLE $t
                                       ^^^

(Gid rid of single quotes....)

John


---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Aliquando et insanire iucundum est


> -----Original Message-----
> From: Anthony Darby [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 21, 2001 4:10 AM
> To: PHP Win
> Subject: [PHP-WIN] INSERT INTO TABLE
> 
> 
> 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]
> 

-- 
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