freshbrains Posted June 20, 2015 Share Posted June 20, 2015 Hello Theres something wrong with my code as I keep getting this error. It points to the bottom line of code. Can you tell me whats wrong with it please? Thank you $connection= mysqli_connect("$db_server","$db_username","$db_password", "$db_database") or die ("could not connect to mysql"); $sqlCommand = mysqli_query($connection,"SELECT * FROM client WHERE username='$myusername' and password='$mypassword'"); $count = mysqli_num_rows($connection,$sqlCommand); Link to comment https://forums.phpfreaks.com/topic/296933-warning-mysqli_num_rows-expects-exactly-1-parameter-2-given/ Share on other sites More sharing options...
fastsol Posted June 20, 2015 Share Posted June 20, 2015 Well it's a pretty straight forward error. You're giving it 2 arguments and it only wants one, the result from the query itself. So remove the $connection. Link to comment https://forums.phpfreaks.com/topic/296933-warning-mysqli_num_rows-expects-exactly-1-parameter-2-given/#findComment-1514434 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.