Re: If else.. display no picture..
| From: | Frank Keessen | Date: | Mon, 07 Apr 2003 06:05:43 +0000 |
| Subject: | Re: If else.. display no picture.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142640@lists.php.net to get a copy of this message | ||
Thanks, and yes, it is pointed out a couple of times..
Regards,
Frank
----- Original Message -----
From: "John W. Holmes" <holmes072000@charter.net>
To: "'Frank Keessen'" <fkeessen@planet.nl>; "'Rasmus
Lerdorf'"
<rasmus@lerdorf.com>
Cc: <php-general@lists.php.net>
Sent: Sunday, April 06, 2003 11:28 PM
Subject: RE: [PHP] If else.. display no picture..
> PUT QUOTES AROUND YOUR STRING. THIS HAS ALREADY BEEN POINTED OUT A
> COUPLE TIMES.
>
> echo "Geen informatie beschikbaar";
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
> > -----Original Message-----
> > From: Frank Keessen [mailto:fkeessen@planet.nl]
> > Sent: Sunday, April 06, 2003 4:39 PM
> > To: Rasmus Lerdorf
> > Cc: php-general@lists.php.net
> > Subject: Re: [PHP] If else.. display no picture..
> >
> > Hi,
> >
> > Sorry;
> >
> > Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in
> > /home/.sites/95/site92/web/steden/steden.php on line 125
> >
> > This is line 125; echo Geen informatie beschikbaar;
> >
> > Regards,
> >
> > Frank
> >
> > ----- Original Message -----
> > From: "Rasmus Lerdorf" <rasmus@lerdorf.com>
> > To: <fkeessen@planet.nl>
> > Cc: <php-general@lists.php.net>
> > Sent: Saturday, April 05, 2003 5:54 PM
> > Subject: Re: [PHP] If else.. display no picture..
> >
> >
> > > I would help if you told us which line the error was on
> > >
> > > On Sat, 5 Apr 2003 fkeessen@planet.nl wrote:
> > >
> > > > Hi,
> > > >
> > > > I'm trying to do the following.. When $stadpict is filled in it
> must
> > display the picture (only the path to the picture is stored in Mysql).
> But
> > when the string ($stadpict) is empty then it must not display the
> picture
> > (and also not display a box with a red cross in it (can't display
> picture!
> > ;>). The only thing i'm getting is an error message...
> > > >
> > > > Parse error: parse error, unexpected T_STRING, expecting ',' or
> ';'
> > > >
> > > > Code;
> > > > <?
> > > > // includes
> > > > include("../conf/config.php");
> > > >
> > > > // open database connection
> > > > $connection = mysql_connect($host, $user, $pass) or die ("Unable
> to
> > connect!");
> > > >
> > > > // select database
> > > > mysql_select_db($db) or die ("Unable to select database!");
> > > > $stedenid=$_GET['stedenid'];
> > > >
> > > > // generate and execute query
> > > > $query2 = "SELECT stedenid, naamstad, stadomschrijvk, stadpict
> FROM
> > steden WHERE stedenid = $stedenid";
> > > > $result2 = mysql_query($query2) or die ("Error in query: $query2.
> " .
> > mysql_error());
> > > > $row2 = mysql_fetch_object($result2);
> > > > if (mysql_num_rows($result2) > 0)
> > > > {
> > > > ?>
> > > >
> > > > <font class="bold"><? echo $row2->naamstad; ?>
> > > > </font>
> > > > <br><br><? echo $row2->stadpict;
> > > > ?>
> > > >
> > > > </td>
> > > > </tr>
> > > > </table>
> > > > <table cellspacing="0" width="405"
> > > > cellpadding="0" border="0">
> > > > <tr style="padding-top:10">
> > > > <td width="139" valign="top"
> > > > style="padding-left:20">
> > > > <?
> > > > while($row->$stadpict > 0)
> > > > {
> > > > ?>
> > > > <img src="../steden/images/<? echo $row->stadpict; ?>"
> > > > border="0"
> > width="108" height="160" alt=""></td>
> > > > <?
> > > > }
> > > > ?>
> > > > <td width="266" valign="top"
> > > > style="padding-right:10;padding-
> > left:10"><?
> > echo $row2->stadomschrijvk;
> > > > }
> > > > else
> > > >
> > > > {
> > > > echo Geen informatie beschikbaar;
> > > > }
> > > > ?>
> > > >
> > > >
> > > > Thanks for helping me out!
> > > >
> > > > Frank
> > > >
> > > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>