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
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.