Jump to content

[SOLVED] chnaging background if if statement


runnerjp

Recommended Posts

humm my $imprtant is not working...can you see where its going wrong??

$getthreads="Select * from forumtutorial_posts where parentid='0' and forum = '$forum' ORDER BY lastrepliedto DESC $max";


$getthreads2=mysql_query($getthreads) or die("Could not get threads");

while($getthreads3=mysql_fetch_array($getthreads2))

{

  $getthreads3[title]=strip_tags($getthreads3[title]);

  $getthreads3[author]=strip_tags($getthreads3[author]);
      $important=$getthreads3[important]
?>
<tr <?php if($important == 1){ echo "bgcolor='#993399'"; } else { echo "bgcolor='#F2F2F2'"; } ?>class='mainrow'><td width="3%"><? if($getthreads3[author] == $puser){ ?> <img src="http://www.runningprofiles.com/images/my folder.gif" alt="My" /> <?}   else { echo 'nooo'; } ?>

Link to comment
Share on other sites

instead of...

$important=$getthreads3[important]

 

try using...

 

$important=$getthreads3['important'];

 

As you can see i aded a semi colon to the end of the variable and also added those small quotes around important

Link to comment
Share on other sites

saldy that did not work in chnaging the colour buti can echo the no 0 or 1!

<?php $getthreads="Select * from forumtutorial_posts where parentid='0' and forum = '$forum' ORDER BY lastrepliedto DESC $max";


$getthreads2=mysql_query($getthreads) or die("Could not get threads");

while($getthreads3=mysql_fetch_array($getthreads2))

{

  $getthreads3[title]=strip_tags($getthreads3[title]);

  $getthreads3[author]=strip_tags($getthreads3[author]);
  $getthreads3[important]=strip_tags($getthreads3[important]);
      $important=$getthreads3['important'];
?>
<tr <?php if($important == 1){ echo "bgcolor='#993399'"; } else { echo "bgcolor='#F2F2F2'"; } ?>class='mainrow'><td width="3%"><? if($getthreads3[author] == $puser){ ?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

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