I am a little new to design and management of webpages, and even more so with databases. However, I have learned a lot in my short time working with it because I am a really fast learner :-) However, I cannot seem to solve this problem as I have looked all over Yahoo! Answers and all over the internet and I cannot find what I am doing wrong.
First, let me tell you my problem, then I will show you the code and maybe someone can help me. I don't really know what I am doing wrong cause no error messages are showing up. It just comes up blank, no error messages or results or anything, just blank. My code is as follows:
<?php
$maincon = mysql_connect("mysql","username","passwo...
if (!$maincon)
{die ("Unable to connect to database: " . mysql_error() };
mysql_select_db("fsg",$maincon);
$result = mysql_query("SELECT * FROM mlb");
if(!$result) die("Query Failed.");
while($row = mysql_fetch_array($result))
{
echo "<a href="" . $row['Link'] . "">" . $row['City'] . " " $row['Name'] . "</a>";
}
mysql_close($maincon);
?>
The "mysql" name for the server is what is required by Yahoo! for their webhosting. The code is to simply disply the teams of the MLB with a link to their page. I think the problem is somewhere in the database related code though, cause nothing is showing up.
Any thoughts would be greatly appreciated. Thank you in advance.
Tags: