Here’s the problem.
I got two php pages.
Both pages got two divs, one left, one right.
The left div contains urls. It’s bascially a list of urls that points to text in the database.
The right div is used for displaying content.
When you click an url in the left div on the first page, it’s supposed to fetch some text from the database and display it in the right div in the second page.
I figured out how do do this many years ago (Maybe I’m getting to old (64 this year)), but when I upgraded my CMS I also had to upgrade the PHP-version and all code hell broke ut.
This is how far I’ve got. This code is on the index page and connects to the database, and it selects some information from the database and converts it into urls.
<?php<br>
$host = "localhost";<br>
$username = "xxxxxxxxxx";<br>
$password = "xxxxxxxxxx";<br>
$dbname = 'xxxxxxxxx';<br>
$conn = mysqli_connect($servername, $username, $password, $dbname);<br>
// Check connection<br>
if (!$conn) {<br>
die("Connection failed: " . mysqli_connect_error());<br>
}<br>
else{<br>
echo "ok";<br>
}<br>
//SELECT<br>
<br><br>
$sql = "SELECT id, title, author, source, text FROM yyyyyyyy";<br>
$result = mysqli_query($conn, $sql);<br>
while($row = mysqli_fetch_array($result))<br>
<br><br>
{<br>
echo("<a href=\"read.php?id=" . $row[0] . "\">" . $row[1] . "</a> " . $row[2] . "<br />");
<br>
}
<br>
mysqli_close($conn);
?>
The urls looks fine, but when I click an url on the index page it gives me a white read.php page.
What am I doing wrong?
All input is appreciated!