RE: Problem
| From: | Jeremy Shovan | Date: | Thu, 06 Nov 2003 20:28:52 +0000 |
| Subject: | RE: Problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-31481@lists.php.net to get a copy of this message | ||
I was able to get rid of the parse error, but what I saw causing the
error was a little strange. All I did was delete the spaces between
your if statement and the bracket that follows ie. if( not if (
The next thing that I did was rewrote the line that says 'echo
"<td>Open</td>";' although I didnt change the line. All I did was
rewrite it exactly the same as it was and the parse error disappeared.
I have never seen anything quite like this before. Theoretically your
code is correct. The only thing I can think of that would contribute to
your error is the editor that you are using. Maybe it is putting some
character between your 'if (' that looks like a space but really isnt a
space.
-----Original Message-----
From: Jacob Hackamack [mailto:JHackamack@spymac.com]
Sent: Wednesday, November 05, 2003 8:00 PM
To: php-db@lists.php.net
Subject: Problem
Currently there seems to be some problem with syntax of some sort, for
some
reason I keep getting thrown back parse errors, commenting out the lines
just moves the parse error line around. If anybody has any help thanks
in
advance.
<?php
include('config.php');
$Period = $_POST["Period"];
$Name = $_POST["Name"];
$conn = mysql_connect ( $dbhost , $dbuser , $dbpass );
$sql_select = 'SELECT * FROM school.physics_chris_rockets WHERE Period
LIKE
'.$Period.' AND Visible LIKE "Y" ORDER by Position, Name, Date';
$result = mysql_query($sql_select);
echo '<title>Physics Sign-Up Input</title>';
echo ' <form action="processinfo.php" method="post"
name="Insert_Record">';
echo ' <input type=hidden name=Period
value="'.$Period.'">';
echo ' <input type=hidden name=Name
value="'.$Name.'">';
echo ' <h2>Welcome '.$Name.', ';
echo ' <table border=1></table>';
$Space = '';
$Data = $dataRow[1] ;
echo' <th scope="col">Position</th>';
echo' <th scope="col">Openings</th>';
echo' <br>';
while ( $dataRow = mysql_fetch_row ( $result ) ) {
if ($Space != $dataRow[3])
{
echo ' <br>';
echo ' <br>';
echo '<br>'.$dataRow[3].'<br>';
$Space = $dataRow[3] ;
}
else
{
echo '<td></td>';
}
if ($Data == "")
{
echo "<td>Open</td>";
}
else
{
echo '<br>'.$dataRow[1].'<br>';
}
}
echo ' </tr>';
echo ' </table>';
echo ' <div align="right">';
echo ' <p><input type="submit" name="submit"
value="Sign
Up" tabindex="12"></p>';
echo ' </form>';
?>
Jacob