good day! i'm an old member of this forum but unfortunately i forgot both my email and pw. >< so i created another account. :)
with all due respect is there somebody who can help me with this code. i've created a menu link from the database
<?php
$con = mysql_connect("localhost","portal","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("stroman", $con);
$result = mysql_query("SELECT * FROM sample");
while($row = mysql_fetch_array($result))
{
echo "<a name='".$row['name']."'"."href='viewlink.php'>". $row['name'] ."</a>". " | " ;
}
mysql_close($con);
?>
the output is this:
example | example
the problem is, i want to show the content of the link from the database to another page. this is my code
<?php
$a=$row['name'];
$con = mysql_connect("localhost","portal","");
if (!$con)
{
die('Could Not Connect: ' . mysql_error());
}
mysql_select_db("stroman", $con);
$result = mysql_query("SELECT * FROM sample WHERE name='$a'");
while($row = mysql_fetch_array($result))
{
echo "<center>";
echo "<h1>". $row['name'] . "</h1>";
echo "<br /><br />";
echo "<img width='250' height='250' src='pictures/".$row['filename']."'/>";
echo "<br /><br />";
echo "<pre>". $row['recipe']."</pre>";
echo "</center>";
}
?>
i want to simply create a menu but from database. thank you so much for your help