- 
	
	
		
		
		
		
			 Mysql_query in a variable not working Mysql_query in a variable not working
			
				
					Error message--
 
 Parse error: syntax error, unexpected T_VARIABLE in /membri/exampletesting/Testing/login.php on line 12
 
 --
 
 
 I dont know why this isnt working. The error says unexpected T_VAR on line 12 but I cant figure out the problem.
 
 
 Code--
 
 <?php
 
 $username = $_POST['username'];
 $password = $_POST['password'];
 
 if ($username&&$password)
 {
 
 $connect = mysql_connect("localhost","root","") or die("Couldnt Connect");
 mysql_select_db("my_exampletesting") or die("Couldnt Find DB");
 
 $query = mysql_query("SELECT * FROM users WHERE username="$username"");------- Line 12
 
 $numrows = mysql_num_rows($query);
 
 if ($numrows!=0)
 {
 
 }
 else {
 die("That user doesn't exist!");
 }
 }
 else {
 die("Please enter a username and a password");
 }
 
 ?>
 
 ---
 
 
 
 
 
 
 
	
	
	
	
	
	
	
	
	
	
	
	
		
		
			
				 Posting Permissions
				Posting Permissions
			
			
				
	
		- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-  
Forum Rules