greatone88
01-31-2005, 03:16 PM
Howdy all,
I got to be missing something obvious as I am unable to open a mysql database with the webhosting I have. I keep on getting the following error message. I really cant see where I am doing anything wrong. I am starting to learn php and mysql and I can't even do this basic thing :( Any help would be appreciated :)
Thanks,
Jimbo
Here is the error message :
Parse error: parse error, unexpected T_VARIABLE in /home/mainlink/public_html/dev/php6_1.php on line 11
Here is my code :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>StatTracker Customers</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<pre>
<? php
// Open the database connection
$connection=mysql_connect("localhost","mainlink_golfer","golfer");
// Select the Stattracker Database
mysql_select_db("mainlink_stattracker", $connection);
// Run the Query on the stattracker thru the connection
$result = mysql_query ("SELECT * FROM customer", $connection);
// While there are still rows in the result set, fetch the current row into the array $row
while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
// Print out each element in the row
foreach ($row as $attribute)
print "($attribute) ";
print "\n";
}
?>
</pre>
</BODY>
</HTML>
I got to be missing something obvious as I am unable to open a mysql database with the webhosting I have. I keep on getting the following error message. I really cant see where I am doing anything wrong. I am starting to learn php and mysql and I can't even do this basic thing :( Any help would be appreciated :)
Thanks,
Jimbo
Here is the error message :
Parse error: parse error, unexpected T_VARIABLE in /home/mainlink/public_html/dev/php6_1.php on line 11
Here is my code :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>StatTracker Customers</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<pre>
<? php
// Open the database connection
$connection=mysql_connect("localhost","mainlink_golfer","golfer");
// Select the Stattracker Database
mysql_select_db("mainlink_stattracker", $connection);
// Run the Query on the stattracker thru the connection
$result = mysql_query ("SELECT * FROM customer", $connection);
// While there are still rows in the result set, fetch the current row into the array $row
while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
// Print out each element in the row
foreach ($row as $attribute)
print "($attribute) ";
print "\n";
}
?>
</pre>
</BODY>
</HTML>
