Jump to content

need help with some code... Beginner!!


fwbbetsy

Recommended Posts

I am trying to get this code to work but keep getting errors:

<?
$hostnm = "localhost";
$usernm = "emeraldc_ustraff";
$pwd = "emeraldc_ustraff";
$dbName = "emeraldc_dbtraff";


$site1="http://www.emeraldcoasttraffic.com";

$data = mysql_query("SELECT * FROM "user")
or die(mysql_error());
Print "<table border cellpadding=3>";
while($info = mysql_fetch_array( $data ))
{
Print "<tr>";
Print "<th>Name:</th> <td>".$info['name'] . "</td> ";
Print "<th>Credits:</th> <td>".$info['credits'] . " </td></tr>";
}
Print "</table>";
?>

The error I get is:
Parse error: parse error, unexpected T_STRING in /home/emeraldc/public_html/test.php on line 10

Any help would be appricated.

thanks

Betsy
Link to comment
https://forums.phpfreaks.com/topic/19798-need-help-with-some-code-beginner/
Share on other sites

I changed it:

<?
$hostnm = "localhost";
$usernm = "emeraldc_ustraff";
$pwd = "emeraldc_ustraff";
$dbName = "emeraldc_dbtraff";


$site1="http://www.emeraldcoasttraffic.com";

$data = mysql_query("SELECT * FROM user)
or die(mysql_error());
print "<table border cellpadding=3>";
while($info = mysql_fetch_array( $data ))
{
print "<tr>";
print "<th>Name:</th> <td>".$info['name'] . "</td> ";
print "<th>Credits:</th> <td>".$info['credits'] . " </td></tr>";
}
print "</table>";
?>

still getting an error but a different one:


Parse error: parse error, unexpected T_STRING in /home/emeraldc/public_html/test.php on line 12

thanks

Betsy

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.