Jump to content

[SOLVED] IF ELSE help - not having much luck with these!


herghost

Recommended Posts

Hi all,

 

Can someone tell me what I am doing wrong with this IF Else query?

 

I am getting a parse error on this line:

 

if  ($rows['userlevel'] > 3) || ($rows['user_id'] == $_SESSION['user_id']) 

 

But I dont know what the problem is!

 

Here is the piece of code in full

 

 <?php
					$sql99="SELECT userlevel
					FROM user_info
					WHERE user_id = '$user_id'";
					$result=mysql_query($sql99);
					while($rows=mysql_fetch_array($result))
						{

					if  ($rows['userlevel'] > 3) || ($rows['user_id'] == $_SESSION['user_id']) 
					{

						$sql2="SELECT * 
						FROM forum_answer 
						WHERE question_id='$id'";
						$result2=mysql_query($sql2);
						while($rows=mysql_fetch_array($result2))
							{
					?>
                        <table width="95%" border="0">
                        <hr> <h3>Reply Number<?php echo $rows['a_id'] ;?></h3>
  <tr>
    <th width="20%">Posted On: </th>
    <td><span style="color:#0F7"><?php echo $rows['a_datetime'] ;?></span></td>
    </tr>
  <tr>
    <th width="20%"><?php echo $rows['a_username'];?>'s Reply:</th>
    <td><span style="color:#00F"> <?php echo $rows['a_answer']; ?></span></td>
  </tr>
</table>
<?php } ?>
<?php 

else
{

echo "Incorrect" ;
}

					?>				

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.