Jump to content

IF statement help


fife
 Share

Recommended Posts

Hi I am trying to perform an echo yes if field from query is equal to one  or no if anything else.  See the code below, Now its erroring saying unexpected t variable in string and its also saying expecting '

It seems to be erroring at the start of my IF statement.

So can anyone please help with what I have done wrong.  This will be my first personal written IF statement so if it is miles off i apologise.

<?php 
	  							$qGetCat = ("SELECT * FROM category ORDER BY `id`");
	 							 $rGetCat = mysql_query($qGetCat) or die(mysql_error());
	  								while($Cat = mysql_fetch_assoc($rGetCat)) {
	  
	  ?>
            <td height="31" align="left" nowrap="nowrap"><?= $Cat['id']  ?></td>
            <td align="left" nowrap="nowrap"><?= $Cat['cat1']  ?></td>
            <td align="left" nowrap="nowrap">
		<?php if $Cat['top']='1' 
						{	echo	"Yes";}
			   else 	{ 	echo	"No";}
			   ?>            </td>
            <td><a href="updatetopcategory.php?=<?= $Cat['id'] ?>"><img src="../images/Edit.png" width="29" height="29" /></a></td>
            <td><img src="../images/delete.jpg" width="29" height="29" /></td>
            <? } ?>

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.