I get this error when I try to run this error when I run the script that this line falls in:
Parse error: parse error, unexpected T_LNUMBER in C:\Program Files\Apache Group\Apache2\mc0\viewMemberInfo.php on line 25
That line is line 25. Someone know what is wrong with it?
Thanks for all help and advice provided. It is greatly apreciated.
echo '<table cellspacing="1" cellpadding="
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Here is the whole thing:
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<?php
$csname = $_GET["memName"];
require("util.php");
$sql = new MySQL_Class;
$sql->Create("mc0");
$sql->Query("Select * from users where (csName = '$csname');
$fname = $sql->data[0];
$lname = $sql->data[1];
$csname = $sql->data[2];
$gun = $sql->data[3];
$rank = $sql->data[4];
$os = $sql->data[5];
print $fname;
print $lname;
print $csname;
print $gun;
print $rank;
print $os;
?>
<table cellspacing=1 cellpadding=1 border=1 bordercolor=black>
<tr><td>First Name: <?php print $fname; ?></td></tr>
<tr><td>Last Name: <?php print $lname; ?></td></tr>
<tr><td>CS Name: <?php print $csname; ?></td></tr>
<tr><td>Favorite Gun: <?php print $gun; ?></td></tr>
<tr><td>current Rank: <?php print $rank; ?></td></tr>
<tr><td>Current OS: <?php print $os; ?></td></tr>
</table>
</body>
</html>
It could have to do with the database interaction because I know very little about it and have done only a few things with MySQL databases from php.
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<?php
$csname = $_GET["memName"];
require("util.php");
$sql = new MySQL_Class;
$sql->Create("mc0");
$sql->Query("Select * from users where (csName = '$csname');
$fname = $sql->data[0];
$lname = $sql->data[1];
$csname = $sql->data[2];
$gun = $sql->data[3];
$rank = $sql->data[4];
$os = $sql->data[5];
print $fname;
print $lname;
print $csname;
print $gun;
print $rank;
print $os;
?>
<table cellspacing=1 cellpadding=1 border=1 bordercolor=black>
<tr><td>First Name: <?php print $fname; ?></td></tr>
<tr><td>Last Name: <?php print $lname; ?></td></tr>
<tr><td>CS Name: <?php print $csname; ?></td></tr>
<tr><td>Favorite Gun: <?php print $gun; ?></td></tr>
<tr><td>current Rank: <?php print $rank; ?></td></tr>
<tr><td>Current OS: <?php print $os; ?></td></tr>
</table>
</body>
</html>
It could have to do with the database interaction because I know very little about it and have done only a few things with MySQL databases from php.
Change
... to ...
Code: Select all
$sql->Query("Select * from users where (csName = '$csname');Code: Select all
$sql->Query("Select * from users where (csName = '$csname')");-
rodrigocaldeira
- Forum Commoner
- Posts: 27
- Joined: Wed Mar 05, 2003 6:40 pm
- Location: Brazil
- Contact:
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
It does if there is a space in the value, plus HTML is slowly but surely going to give way to XHTML which does require that all attribute values are quoted with double quotes. It's a good idea to get into the habit of that now so your code won't have issues with browsers in the long run.patrikG wrote:HTML doesn't actually make a difference whether or not you use quotes around values.
Mac
