I am playing with PHP on my Synology NAS. I have PHP 7.2 and MariaDB 10 running. I cannot figure out why I am having issues with connecting to my database.
If I use the object oriented version of mysqli I receive " 500 There is an error while processing this request"
<?php
/* DB CONN INFO */
$db_server = 'localhost';
$db_user = 'g_web';
$db_pass = 'hH5@fjQ*I.';
$db_name = 'barpsc';
//$db_conn = new mysqli($db_server,$db_user,$db_pass,$db_name);
$db_conn1 = new mysqli($db_server,$db_user,$db_pass,$db_name);
$result = mysqli->query("Select 'A world full of php' AS _msg from class_tbl");
$row = $result->fetch_assoc();
echo $row['_msg'];
?>
however if I use the older procedural code I get a result. "A world full of "
[b]Procedural[/b]
<?php
/* DB CONN INFO */
$db_server = 'localhost';
$db_user = 'g_web';
$db_pass = 'myPasswordHere';
$db_name = 'barpsc';
//$db_conn = new mysqli($db_server,$db_user,$db_pass,$db_name);
$db_conn1 = mysqli_connect($db_server,$db_user,$db_pass,$db_name);
$result = mysqli_query($db_conn1, "Select 'A world full of ' AS _msg from class_tbl");
$row = mysqli_fetch_assoc($result);
echo $row['_msg'];
?>