PHP is making errors for no apparents reason..?
| From: | newton | Date: | Sat, 27 Apr 2002 14:19:21 +0000 |
| Subject: | PHP is making errors for no apparents reason..? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-94878@lists.php.net to get a copy of this message | ||
Hi all..
I've been trying to understand actually what is the error in the following code for 2 hours,
i played with the code, moved stuff around and the like but nothing worked.. Can someone help me
please?
The PHP error is as follow:
Parse error: parse error in /usr/home/iro/numripps.php on line 13
<?
$query = "SELECT handle from x";
$res = mysql_query($query);
while ($row = mysql_fetch_array($res)) {
$xquery = "SELECT handle from husers WHERE handle like '$row[handle]'";
$xres = mysql_query($xquery);
$chck = mysql_num_rows($xres);
if (!$chck) {
$zquery = "SELECT name from users WHERE handle like '$row[handle]';
$zres = mysql_query($zquery);
$zrow = mysql_fetch_array($zres);
$user = $zrow[name];
$query = "INSERT into husers values (\'$row[handle]\' ,
\'$user\')";
mysql_query($query);
}
}
?>
When i changes the " " of the line 13 for ' '
there is another error but thise time after the ?>.. Where did i go wrong? i see nothing wrong in
here.
(Btw i know my code is ugly but it's still suposed to work.)
Thanks in advance if you help me.