wrekanyze Posted April 3, 2007 Share Posted April 3, 2007 I'm using Drupal(a CMS), along with MySQL and PHP to import data into a database. I'm trying to import a bunch of sentences on one page into the database, but each in their own row. For example: News ----- Brand new site New employee hired New work acquired Basically, I need to know how to pull those into the database as one row each, instead of pulling all three elements into the database in the same row. They're all stored in a $content tag, b/c I wrote the page in PHP. So, any ideas on how to make it, so I can insert the $content into the database, but at a line break, I need to insert a new row? Any help is greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/45411-importing-data-to-mysql-from-web-page/ Share on other sites More sharing options...
komquat Posted April 3, 2007 Share Posted April 3, 2007 may need to use a for () loop and change the tag to $contact Link to comment https://forums.phpfreaks.com/topic/45411-importing-data-to-mysql-from-web-page/#findComment-220500 Share on other sites More sharing options...
wrekanyze Posted April 3, 2007 Author Share Posted April 3, 2007 Actually, I think I found part of my answer. I think I need to explode the $content as follows: explode('delimiter', $content); But I have no idea how to make a line break a delimiter. Would that just be the /n in the delimiter field? Link to comment https://forums.phpfreaks.com/topic/45411-importing-data-to-mysql-from-web-page/#findComment-220502 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.