moosey_man1988 Posted May 29, 2015 Share Posted May 29, 2015 Hi Everyone, I'm quite new to php, I was getting along just fine until I hit this really annoying problem with a table, the table is a notes table and basically When i upload a file It writes to this table, I just want to get the basic functionality of it working first on the right side of the table there should be a an icon based on what is in the row for example if the column has a note it will display a blue pen logo and if the column has an upload I want it to display a blue notepad logo with a link to the notepad file like so at the moment if I do "if followed by if" I get ONLY the notepad, if I do "if followed by elseif" I only get the blue pen, please help <div class="notestable"> <?php if($note_rs['method']= "note"){ $method= "images/icons/blue_circle_pen.png"; } elseif($note_rs['method']= "PlainText") $method= "images/icons/blue_circle_notepad.png"; ?> <table> <?php if(mysql_num_rows($note_query)!=0) { do { ?> <tr><td><?php echo $note_rs['customerId']; ?></td> <td><?php echo $note_rs['note']; ?></td> <td><?php echo $note_rs['user']; ?></td> <td><?php echo date("d-m-Y H:i:s", strtotime($note_rs['Date']));?></td> <td><a href="<?php echo $note_rs['location']."/".$note_rs['fileName'];?>"><img src="<?php echo $method;?>" style="width:30px;"></a> <?php } while ($note_rs=mysql_fetch_assoc($note_query)); } else { echo "No results found"; } ?> </table></div> Quote Link to comment Share on other sites More sharing options...
Solution jcbones Posted May 29, 2015 Solution Share Posted May 29, 2015 You are assigning values, not comparing them. = (assignment) == (comparison) Quote Link to comment Share on other sites More sharing options...
moosey_man1988 Posted May 29, 2015 Author Share Posted May 29, 2015 HAHA got I hate == LMAO thank you let me try that out <3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.