Guest Posted January 27, 2007 Share Posted January 27, 2007 I got a problem thats kind of hard to explain so it is kind of hard to look for. I want to store a bunch of data into a db I want to pull it out and put each line into an array line one array(0) line 2 array(1) and so o how can I do this? Link to comment https://forums.phpfreaks.com/topic/35931-solved-line-parsing/ Share on other sites More sharing options...
trq Posted January 27, 2007 Share Posted January 27, 2007 Assuming you have this data in a file.....[code]<?php // connect $array = file('file.ext'); foreach ($array as $line) { if (mysql_query("INSERT INTO tbl (fld) VALUES ('$line')")) { echo "successfully added $line to the database"; } }?>[/code] Link to comment https://forums.phpfreaks.com/topic/35931-solved-line-parsing/#findComment-170407 Share on other sites More sharing options...
Guest Posted January 27, 2007 Share Posted January 27, 2007 Thank you that didnt quite answer it but i think i got it from there. Link to comment https://forums.phpfreaks.com/topic/35931-solved-line-parsing/#findComment-170413 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.