-4

.../general.php on line 10

Hello, this is my error, but only occurs when I upload my web to a host, in the localhost run well.

the (return mysqli_real_esc..)line is the "line 10".

$conncet = mysqli_connect('xxx','xxx','xxx','xxx');
function array_sanitize(&$datos) {
  global $connect;
  $datos = mysqli_real_escape_string($connect,$datos);
}

thanks for your time!!

Jeff
  • 1
  • 1
  • 4
  • 1
    Your $connect variable is probably NULL. Look where you made the connection to the database and check if that part is correct. Did you enter the correct username/password/host combination? – Dacaspex Jul 22 '16 at 16:50
  • 2
    `$conncet` != `$connect` – Charlotte Dunois Jul 22 '16 at 16:52
  • If you were running with error_reporting and display_errors enabled, you'd have been told about your undefined variable. Those settings should NEVER be off on a devel/debug system. – Marc B Jul 22 '16 at 16:54
  • Thanks!! jajajaja my error – Jeff Jul 22 '16 at 17:05

4 Answers4

0

You misspelt connect in your initialization. You spelt it conncet. The only reason I can think for that running well on localhost is if errors are set not to show.

VortixDev
  • 965
  • 1
  • 10
  • 23
0

first off there is a spelling error on your first line "$conncet" should be $connect

Danimal
  • 315
  • 1
  • 16
0

i think you have typo in your variable, please check your $connect => $conncet variable

$conncet = mysqli_connect('xxx','xxx','xxx','xxx');
function array_sanitize(&$datos) {
  global $connect;
  $datos = mysqli_real_escape_string($connect,$datos);
}
FPratama
  • 14
  • 3
-1

I suspect that your credentials(username & password) is wrong on the web. Find your username and password for the online database.

Robby Lebotha
  • 1,211
  • 11
  • 9