PHP - MySQL special character -> mysql problem?

From: Date: Mon, 19 Mar 2001 12:42:35 +0000
Subject: PHP - MySQL special character -> mysql problem?
Groups: php.general 
Request: Send a blank email to php-general+get-44532@lists.php.net to get a copy of this message
Hello, I am wrining a script that insert students in a database: name, email,.... the data retrive (from text-file) and storing (into database) works fine, but when I want to check if a student is already in the database, I look for the email address, and when I use: $check_email = mysql_query("SELECT student_id FROM pdc_student WHERE student_email=\"".$student_email."\"", $con); $number = mysql_numrows($check_email); if ($number == 0) { ....... OR $check_email = mysql_query("SELECT student_id from pdc_student where 1 and student_email like \"$student_email\"", $con); $number = mysql_numrows($check_email); if ($number == 0) { ........ it works fine EXCEPT if the email address contains "_" for example, if I try to add a student with email: name_test@try.fi, it won't be able to find if the email exists already in the db, it will just add that student even if the email exists already. And this "_" is allowed for email address... :( Anybody encounters that problem and could help me to solve it? Thanks, -Alain-

« previous php.general (#44532) next »