RE: [PHP] parse error driving me nuts ...
| From: | Andrew | Date: | Thu, 15 Feb 2001 15:49:36 +0000 |
| Subject: | RE: [PHP] parse error driving me nuts ... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39920@lists.php.net to get a copy of this message | ||
Jon, John, Ifrim, the == worked ... thank you!!
gotta read up on it now :)
Cameron, dropping the extra () did not work :(
thanks for the suggestions folks!
andrew
> -----Original Message-----
> From: Jon Haworth [mailto:JHaworth@witanjardine.co.uk]
> Sent: Thursday, February 15, 2001 10:38 AM
> To: 'andrew@salamander.net'; 'php-general@lists.php.net'
> Subject: RE: [PHP] parse error driving me nuts ...
>
>
> Instead of
>
> if ((mysql_num_rows($result)) = 1)
>
> try
>
> if ((mysql_num_rows($result)) == 1)
>
>
> HTH
> Jon
>
> -----Original Message-----
> From: Andrew [mailto:andrew@salamander.net]
> Sent: 15 February 2001 15:34
> To: php-general@lists.php.net
> Subject: [PHP] parse error driving me nuts ...
>
>
> hi, can anyone help me spot the parse error?
> It's throwing up on the first "if" line, and for the life of me I cannot
> find it! :)
>
> tia,
> andrew
>
> <?php
>
> include("db_connect_params.inc");
> $sql="select path from PHOTO where pid =1";
> $link_id = mysql_connect($host, $usr, $pass);
> $result = mysql_db_query($database, $sql, $link_id) or die("no result");
>
> if ((mysql_num_rows($result)) = 1)
>
> {
> $row=mysql_fetch_array($result);
> extract($row);
> echo "<img src =\"$path\"></img><br>";
>
> } else {
> if (!isset($ii)) $ii = 1;
> $i = 1;
> while($row=mysql_fetch_array($result))
> {
> extract($row);
> $displayed[$i]=$path;
> echo "<a
> href=\"$PHP_SELF?ii=$i\">$i</a>  ";
> $i++;
> }
> echo "<img src =\"$displayed[$ii]\"></img><br>";
> }
> ?>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>