I don't know the problem with log in file | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I don't know the problem with log in file

In the browser it out puts the following: Connected successfully Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in C:\xampp\htdocs\social\login.php on line 14 Fatal error: Uncaught Error: Call to undefined function mysql_query() in C:\xampp\htdocs\social\login.php:27 Stack trace: #0 {main} thrown in C:\xampp\htdocs\social\login.php on line 27 The source //Function to sanitize values received from the form. Prevents SQL injection function clean($str) { $str = @trim($str); if(get_magic_quotes_gpc()) { $str = stripslashes($str); } return mysqli_real_escape_string($str); //line 14 } //Sanitize the POST values $UserName = clean($_POST['UserName']); $Password =(md5($_POST['Password'])); //Create query $qry="SELECT * FROM members WHERE UserName='$UserName' AND Password='$Password'"; $result=mysql_query($qry); //line 27 Where is the problem guys

13th Jan 2020, 5:58 AM
Stephen Phiri
Stephen Phiri - avatar
1 Answer
13th Jan 2020, 10:47 PM
phil