Reference link:
1 https://stackoverflow.com/questions/40650747/uncaught-error-call-to-undefined-function-mysql-select-db
The solutions are as follows:
<?php
$username="root";
$password="namungoona";
$hostname = "localhost";
//connection string with database
$dbhandle = mysqli_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "";
// connect with database
$selected = mysqli_select_db($dbhandle, "police")
or die("Could not select examples");
//query fire
$result = mysqli_query($dbhandle,"select * from News;");
$json_response = array();
// fetch data in array format
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
// Fetch data of Fname Column and store in array of row_array
$row_array['Headlines'] = $row['Headlines'];
$row_array['Details'] = $row['Details'];
$row_array['NewsPhoto'] = $row['NewsPhoto'];
//push the values in the array
array_push($json_response,$row_array);
}
//
echo json_encode($json_response);
mysqli_free_result($result);
?>
Read More:
- Fatal error: Uncaught Error: Call to undefined function mysql_ Connect() problem solving
- Fatal error: Uncaught Error: Call to undefined function mysql_connect()
- Uncaught error: call to undefined function MySQL when building sqli lab environment with phpstudy_ Connect() error
- PHP connection to MySQL database error: call to undefined function MySQL_ connect()
- Call to undefined function mysql_ Connect() solution summary
- R note for Bioinfo: the column for the select call is undefined
- mysql workbench Error Code: 1046. No database selected Select the default DB to be used
- Call to undefined function oci_ Connect() problem solving
- PHP connection PostgreSQL error call to undefined function PG_ connect()
- PHP error: call to undefined function curl_ init() window
- Uncaught Error: No select2/compat/inputData
- Call to a member function fetch_assoc() on a non-object
- MySQL workbench insert data prompt error: 1046 (errorcode: 1046. No database select…)
- Fatal error: Call to a member function bind_param() on a non-object in
- 【ERROR_2】Call to a member function bind_param() on a non-object
- django.core.exceptions . improveconfigured: error loading MySQL DB module. Django configuring MySQL database
- call to member function bind_param() on boolean………..
- A call to an OS function failed
- uncaught typeerror:cannt set property ‘0‘ of undefined
- PHP Fatal error: Call to a member function query() on a non-object in