Re: If else.. display no picture..

From: Date: Sun, 06 Apr 2003 20:38:44 +0000
Subject: Re: If else.. display no picture..
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-142613@lists.php.net to get a copy of this message
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 >

« previous php.general (#142613) next »