I think I'm missing something simple but I'm tired so I may need a second pair of eyes🙂
This is just a sample code right now. I want this php script to ead from a recipes database and just display the directions. My page is not displaying anything though when I load it in the browser though. I know that the php is working because when I do view/source no html code comes up. It's not doing anything, yet there are no errors being spit out. Here is the code. Thanks
<html>
<head>
<title>Untitled Document</title>
</head>
<body text="#000000">
<?php
//connect to database server
$connect= @mysqlconnect ("localhost", "username", "password");
If (!connect) {
echo ("<p>Unable to connect to server at this time. Please try again later.</p>");
exit();
}
//select recipes database
If (!@mysql_select_db("Recipes")) {
echo ("<p>Database unavailable at this time. Please try again later.</p>");
exit();
}
//request text of all the recipes
$result=mysql_query ("select directions from Afghanistan");
If (!result) {
echo ("<p>Error performing query: " . mysql_error() . " </p>");
exit();
}
// Display the text of each directions in a paragraph
while ( $row = mysql_fetch_array($result) ) {
echo("<P> $row[Directions] </P>");
}
?>
</body>
</html>