Jump to content

Tricky table


moosey_man1988

Recommended Posts

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>

post-178672-0-41238000-1432920311_thumb.png

Link to comment
https://forums.phpfreaks.com/topic/296541-tricky-table/
Share on other sites

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.