I am new to PHP and MySQL so am in need of some help please.
I am using MySQL through PHP MyAdmin.
I have a results page to a MySQL search and formatted it so that they come up as an HTML table.
This is it's code:
<table border="0" align="center">
<tr><!--Change colspan number as appropriate -->
<td colspan="7">Number of records found: <?php echo mysql_num_rows($result); ?></td>
</tr>
<tr>
<th>TW</th>
<th>LW</th>
<th>Wks</th>
<th>Title</th>
<th>Artist</th>
</tr>
<?php $i = 1; while($row = mysql_fetch_array($result)){ ?>
<tr>
<td><?php echo stripslashes($row['TW']); ?></td>
<td><?php echo stripslashes($row['LW']); ?></td> //image or formatted RE
<td><?php echo stripslashes($row['Wks']); ?></td>
<td><?php echo stripslashes($row['Title']); ?></td> //upper case
<td><?php echo stripslashes($row['Artist']); ?></td>
</tr>
<?php $i++; } ?>
</table>
Could some guru please amend the code for me where the comment Upper Case so that it will appear all in upper case. I know it uses the function strtoupper() but I don't know how to put the code into this table row.
[php]
<td><?php echo strtoupper(ststripslashes($row['Title'])); //upper case ?></td>
[/php]
The field where the comment for Image is, what I want is that if this field has new entered it will automatically insert a certain graphic. Also if this field of the MySQL database has a zero (0) entered, I wish it to automatically insert the letters RE in Yellow and bold.
[php]
<td>
<?
if($row['LW']=='new') {
echo "<img src=\"new.gif\">";
}
elseif($row['LW']==0) {
echo "<font color="yellow"><strong>RE</strong></font>
}
?></td> //image or formatted RE[/php]
If you need anything else, let me know.
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
Offline 1,227 posts
since Feb 2002