Jump to content

divinedesigns1
 Share

Recommended Posts

hey morning all, i keep having this error and im not sure what exactly to do

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\wamp\www\TINCS 2012 Edit\admin\login.php on line 12
i try adding the variable to connect to the database but that didnt work, then i try leaving the query only in it, that didnt work either then i try the result that didnt work either, dont mysqli_num_rows(); just need the $query only or the connect variable and the query? Note: I am looking up these errors and function that i dont know how to fix it, if i get it fix ill say how i fixed it
Link to comment
Share on other sites

nevermind i fixed it, i had the mysqli_num_rows(); outside of the if statement, which depended on the result like this:

$login_check = mysqli_num_rows($result);if($result){ }

so i just placed it into the if statement like what is shown below and it fix the error

if($result){ $login_check = mysqli_num_rows($result);}

Link to comment
Share on other sites

This is the way I understand how it works procedural style:

$result = mysqli_query($dbconnection, "SELECT * FROM table"); $rows = mysqli_num_rows($result);

$rows should then contain the number of rows.

Edited by Don E
Link to comment
Share on other sites

This is the way I understand how it works procedural style:
$result = mysqli_query($dbconnection, "SELECT * FROM table"); $rows = mysqli_num_rows($result);

$rows should then contain the number of rows.

okie ill write that down, also do you know what this mean
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\wamp\www\TINCS 2012 Edit\admin\login.php on line 28
its asking for the semicolon but its there already, the line below is where the error is coming from
echo '<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">';

EDIT: the semicolon is there on each line where it needs to be and in the correct places where it need to be, well it should be in the correct places

Edited by DDs1
Link to comment
Share on other sites

i fix the error, by remove the <?php $_SERVER['PHP_SELF']; ?> but i would like to know why it wasnt working with that in it, shouldnt it work even if it have that in it?

Link to comment
Share on other sites

Try this by removing the PHP tags because since you're echoing to begin with, it looks like you have opening and closing PHP tags already established for this particular page or segment of code for that page.

echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">';

Edited by Don E
Link to comment
Share on other sites

Try this by removing the PHP tags because since you're echoing to begin with, it looks like you have opening and closing PHP tags already established for this particular page or segment of code for that page.
echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">';

ooo ok i got it now thanks don
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...