Jump to content


Photo

importing a text file


  • Please log in to reply
2 replies to this topic

#1 blanktarget

blanktarget
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 04 November 2003 - 09:59 PM

I can\'t get this text fle imported. I have over one hundreditems I want into one field, the table has two fields, an auto_increm id field and the other field which is varchar data. I get all manner of errors inserting them.
:cry:
$sql= \"INSERT INTO table (\'column_2\') VALUES (\'item_1,\')\";
\"INSERT INTO table (\'column_2\') VALUES (\'item_2,)\";
etc 100 times.

if (@mysql_query($sql)) {
echo(\"<h4 align=\'center\'>Your listing has been added</h4><br>\");
} else {
echo(\"<h4>Error the adding the listing: \" .
mysql_error() . \"</h4>\");
}

what is wrong?
It\'s not that I don\'t know how to do it, i just haven\'t learned it yet.

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 04 November 2003 - 10:04 PM

Have a look at this posting

http://www.phpfreaks...&highlight=load
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#3 blanktarget

blanktarget
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 04 November 2003 - 11:19 PM

thanks :D
It\'s not that I don\'t know how to do it, i just haven\'t learned it yet.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users