by mickeymouse » 31. August 2021 15:49
Can you help me understand this error message?
I suspect my problem is with the query statement but can't see what's wrong as I'm following documentation.
How can I check if if the $result of my query contains anything? I've tried different things but no success.
Also, isn't the "undefined function" "pg_fetch_all" which to me is a defined function.
Fatal error: Uncaught Error: Call to undefined function pg_fetch_all() in C:\xampp\htdocs\HA_LogInCheck.php:66 Stack trace: #0 {main} thrown in C:\xampp\htdocs\HA_LogInCheck.php on line 66
My code is:
$link= mysqli_connect($host, $username, $password);
if (!$link){die("Not connected : " . mysqli_errno() . MySQL_error());}
$db_selected = mysqli_select_db($link,$database);
if (!$db_selected){die ('Can\'t use ' .$database .':'. mysqli_error());}
print("$db_selected<br>"); //<---------print result = 1 so the connect and database select work.
$result = mysqli_query($link, "SELECT * FROM `hausers` WHERE `userid`='$UserID' || `perid`='$UserID'", MYSQLI_USE_RESULT);
//DOCUMENTATION = $arr = pg_fetch_all($result);
$arr = pg_fetch_all_all($result); //<----------------Line 66