Site only works local, does not work online

Asked

Viewed 144 times

1

I have a simple connection that my application uses to connect to the bank mysql.

Locally everything was fine, but putting it online no longer works. I have changed several possible terms to the error that I saw here in the topic and it did not work. The connection to the bank is correct, but the login check will not.

Follows my code:

Connexion.php

Código de conexão com o banco de dados

Login.php

Função para verificação de login e senha

Error

conexao_ok Warning: mysqli_num_rows() expects Parameter 1 to be mysqli_result, Boolean Given in /customers/0/f/7/theydo.com.br/httpd.www/bd/Logar.php on line 9 Login_error

Note: I have tried mysql_num_rows, it still didn’t work out.

  • 1

    Welcome home, my friend edit your question and put the code instead of image! Enjoy and do the Tour to learn how the community.

  • Tries if($sql && mysqli_num_rows($sql) > 0)

  • Connection data is correct? Add one or die($dbcon->error); after the select. Check whether $dbcon->query is returning false for mysqli_num_rows only accepted mysqli_result. Ps.: It makes no sense to use a part POO and another part procedural.

  • Thank you personally, I will pay attention, it is the first question I ask in the forum, I will check the two questions, thank you very much, I will give the answer if I have solved or not

  • Due to the error message, there was some error in your query. You need to get the apache log error message.

  • I changed the line as suggested by dvd, if($sql && mysqli_num_rows($sql) > 0), connection started to validate and also had to change the table name to lowercase. Perfect now. Interesting as a change from local scripts to online, to these changes.

Show 2 more comments

1 answer

0

I had a problem recently at a hostgator’s lodge. I had to create a php.ini file and activate the extension at hand. It tries to analyze whether the mysqli dll is enabled in your server’s php. I hope it helps you brother.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.