spires Posted March 26, 2008 Share Posted March 26, 2008 Hi Guys. I'm trying to upload a list, row by row into my database. Basically, I have a list of words that are in an array. But I can't get them to upload row by row. Example. array: blackberry blackberry pearl blackberry curve blackberry 8800 Thanks for your help Link to comment https://forums.phpfreaks.com/topic/98048-upload-multiple-rows-into-mysql-at-once/ Share on other sites More sharing options...
cooldude832 Posted March 26, 2008 Share Posted March 26, 2008 you don't "upload" to mysql you "insert" and without table structure, php structure its hard to decrypt your problems Link to comment https://forums.phpfreaks.com/topic/98048-upload-multiple-rows-into-mysql-at-once/#findComment-501664 Share on other sites More sharing options...
spires Posted March 26, 2008 Author Share Posted March 26, 2008 Sorry, Half a sleep. I've got it working now foreach ($keyword_array as $keyword) { $keyword = trim($keyword); $sel_sql = "SELECT * FROM blackberry ORDER BY id DESC"; $sel_query = mysql_query($sel_sql) or die (mysql_error()); $count = mysql_num_rows($sel_query); while($keyword){ $row = mysql_fetch_array($sel_query); $keyID = $row['id']; } $sql = "INSERT INTO blackberry (keywords, code, engine, merchant) VALUES ('$keyword', '$eng$keyID', '$engine', '$merchant')"; mysql_query($sql) or die (mysql_error()); $key .= trim($keyword)."<br>"; } Link to comment https://forums.phpfreaks.com/topic/98048-upload-multiple-rows-into-mysql-at-once/#findComment-501701 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.