A
Anonymous
Guest
I'm new at coding but to me this is a basic simple problem, even though I've asked a few people and they look at me like I have two heads.
What I want to do is have an index page generated from a MySQL table. I have the table made and am using this code to make the NAMES on the index page:
<?php
$dbh=mysql_connect ("localhost", "******", "******") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("********",$dbh);
$sql = "SELECT * From photos";
$result = mysql_query($sql, $dbh) or die(mysql_error());
while ($newArray = mysql_fetch_array($result)){
$Name = $newArray['Name'];
echo "<strong>$Name</strong> <br><br>";
}
?>
This works fine but here is my problem:
I want to make each name clickable so that when clicked the next page will be a page where the information for that singular name is displayed. So that when each name is clicked on the index page, the same page will come up with whatever the information is for that name. This way if I have 50 names, I won't have 50 HTML pages, only the one page that is used over and over.
Thanks,
:?:
What I want to do is have an index page generated from a MySQL table. I have the table made and am using this code to make the NAMES on the index page:
<?php
$dbh=mysql_connect ("localhost", "******", "******") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("********",$dbh);
$sql = "SELECT * From photos";
$result = mysql_query($sql, $dbh) or die(mysql_error());
while ($newArray = mysql_fetch_array($result)){
$Name = $newArray['Name'];
echo "<strong>$Name</strong> <br><br>";
}
?>
This works fine but here is my problem:
I want to make each name clickable so that when clicked the next page will be a page where the information for that singular name is displayed. So that when each name is clicked on the index page, the same page will come up with whatever the information is for that name. This way if I have 50 names, I won't have 50 HTML pages, only the one page that is used over and over.
Thanks,
:?: