Jump to content

Tricky table


moosey_man1988
Go to solution Solved by jcbones,

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