RE: [PHP-WIN] INSERT INTO TABLE

From: Date: Mon, 21 May 2001 12:25:11 +0000
Subject: RE: [PHP-WIN] INSERT INTO TABLE
Groups: php.windows 
Request: Send a blank email to php-windows+get-7782@lists.php.net to get a copy of this message
[> 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 - jasendorf@lcounty.com 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:adarby@bluestones.co.uk] > 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: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.windows (#7782) next »