Hello...I'm new to programming with PHP, but as I'm going through tutorials and reading books I've come across a question I have not been able to figure out.
I have a table with 2 fields....one field is just text and the other is for a URL.
I want to have a link created that uses the url for the link and the text field for the text.
Here is the code I have so far, but I cannot get it to work:
Code:
<html>
<head>
<title>Test Page</title>
</head>
<body>
<?php
mysql_connect('hostname','username','password');
mysql_select_db('db_name') or die (mysql_error());
$result = mysql_query("SELECT * from patterns");
$row = mysql_fetch_array($result);
echo <a href="$row[lnktxt]">$row[dsptxt]</a>;
}
?>
</body>
</html>
Any help would be appreciated