Page 1 of 1
echo '<table cellspacing="1" cellpadding="
Posted: Sun Mar 02, 2003 7:30 pm
by nigma
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.
Posted: Mon Mar 03, 2003 2:03 am
by twigletmac
What does the line (and the few lines above it) look like?
Mac
Posted: Mon Mar 03, 2003 9:02 am
by nigma
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.
Posted: Mon Mar 03, 2003 10:00 am
by phice
Change
Code: Select all
$sql->Query("Select * from users where (csName = '$csname');
... to ...
Code: Select all
$sql->Query("Select * from users where (csName = '$csname')");
Posted: Mon Mar 03, 2003 2:08 pm
by nigma
Thanks a bunch man. I can't belive I missed that while running through code and checking for obvious problems.
Posted: Thu Mar 06, 2003 12:29 pm
by rodrigocaldeira
Try to do this:
echo "<table cellpadding=\"2\"....";
this works perfectly!!
Posted: Thu Mar 06, 2003 2:16 pm
by patrikG
HTML doesn't actually make a difference whether or not you use quotes around values.

Posted: Fri Mar 07, 2003 1:53 am
by twigletmac
patrikG wrote:HTML doesn't actually make a difference whether or not you use quotes around values.

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.
Mac