The below is all code in a page.
Sadly, the browsing result of it still produces nothing.
<?php
declare(strict_types=1);
error_reporting(-1);
ini_set('display_errors', '1');
$dbSevername='localhost';
$dbUsername='root';
$dbPassword='la1asql';
$dbName='mysql';
$dbConnect=mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbName);
$query="select authentication_string from user where user='root'";
$sql=mysqli _query($query);
$row=mysqli_fetch_assoc($sql);
$authentication_string=$row['authentication_string'];
echo $authentication_string;
?>
If database connecting is possible without PDO,
I like to make it to succeed in database connecting without PDB first.
if I succeed in db connecting without PDO, I may go to PDO
because benanamen and some other members recommend it strongly., but after succeeding it without PDO.
By the way, the word “PDO” seems an abbreviation.
What is the full word of PDO?
I copied and pasted your script and tried it on my computer and added my debug function named fred(…) because it is a lot easier to type than debug(…);
There was a strange syntax error: Parse error : syntax error, unexpected ‘_query’ (T_STRING) in /var/www/aatests/joon1-001.php on line 17
Yes, those are really careless mistakes.
When i make this kind of mistakes, I usually find it and fix it by myself,
But this time
Because I have no confidence of correct db connecting, I failed in finding mistalke.
Anyway I am so sorry about the misakes.
And by the way, I fixed two mistakes in the code,
But the result still shows nothing.
That’s fine, it is interesting to see why your code doesn’t seem to work even once the typos are fixed. But at some point, it might be a good thing to drop the thing you can’t get working, and who knows, maybe PDO will just work straight off for you.
If your code is showing nothing at all, not even any error messages, even if you right-click and “view source”, how are you executing it? Are you opening it with a “http://localhost/whatever” in your browser, or browsing to it with “file://c:\whatever”? The former is the correct way and should / will execute the PHP code on the server - the latter is just opening the file and relies on the browser to run the code, which it will not.
look at the developer console (F12 in the browser) and there in the “network” tab. If you et a 500 error, you have to look in the webservers error.log to see the message.
I think you are trying to get the whole script to work and should be testing very small chunks starting at the top because PHP starts at the first line then proceeds to process the script one line at a time.
The modified script I supplied in a previous post was based on your revised script. Along with the script is the output from a very simple table. Did you try running the script? If it does not run and produce a blank screen then start remming near the top until an error is showing, once the error is cleared then move the rem further down,