<?php $lines = file('file.txt'); foreach($lines as $num => $line){ $fullname = "name"; $email=addslashes($line); $password = base64_encode(password); mysql_query("INSERT INTO table (fullname,email,password) VALUES('$fullname','$email','$password')") or die("Insert failed: " . mysql_error()); } ?> PHP: please see the above code i want to add addslashes for $email but this is not doing in the way i mentioned above where i mistaken it do not gives any error
I don't know what the exact problem is, but I do know that you're supposed to quote strings for SQL with mysql_real_escape_string() nowadays.