cluce Posted June 18, 2007 Share Posted June 18, 2007 can someone give me some advice on how to import a csv file and make the passwords store in a hash form such as md5 or sha-1. It would be to much to code the INSERT VALUES....way. I am trying to find an easier way. Is there a feature in one of these free gui versions of mySQL that will do this???? Quote Link to comment https://forums.phpfreaks.com/topic/56046-trying-to-import-a-csv-file-with-usernames-and-passwords-in-sha-1/ Share on other sites More sharing options...
trq Posted June 18, 2007 Share Posted June 18, 2007 It would be to much to code the INSERT VALUES....way Just create a loop to do the inserting. You might start with file. Quote Link to comment https://forums.phpfreaks.com/topic/56046-trying-to-import-a-csv-file-with-usernames-and-passwords-in-sha-1/#findComment-276777 Share on other sites More sharing options...
cluce Posted June 18, 2007 Author Share Posted June 18, 2007 thats what I am thinking but I do not know to get the values from the csv file to do that Quote Link to comment https://forums.phpfreaks.com/topic/56046-trying-to-import-a-csv-file-with-usernames-and-passwords-in-sha-1/#findComment-276781 Share on other sites More sharing options...
trq Posted June 18, 2007 Share Posted June 18, 2007 What part exactly are you stuck on? Do you know how to read a file at all? Quote Link to comment https://forums.phpfreaks.com/topic/56046-trying-to-import-a-csv-file-with-usernames-and-passwords-in-sha-1/#findComment-276786 Share on other sites More sharing options...
cluce Posted June 18, 2007 Author Share Posted June 18, 2007 OH. there is code to open and read the file??? IF so, I never did that before with php. Quote Link to comment https://forums.phpfreaks.com/topic/56046-trying-to-import-a-csv-file-with-usernames-and-passwords-in-sha-1/#findComment-276791 Share on other sites More sharing options...
cluce Posted June 18, 2007 Author Share Posted June 18, 2007 I got it but how do I read parts of the file at a time such as how do I get the usernames under one column and the passwords under the other so I can store them in two strings for looping. this is what I have ......... <?php $filename = "ad.csv"; $fp = fopen($filename, "r") or die("Couldn't open $filename"); while (!feof($fp)) { $line = fgets($fp, 1024);////I know I need to modify this into something??? echo $line."<br/>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/56046-trying-to-import-a-csv-file-with-usernames-and-passwords-in-sha-1/#findComment-276816 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.