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: Number of records found: <?php echo mysql_num_rows($result); ?> TW LW Wks Title Artist <?php $i = 1; while($row = mysql_fetch_array($result)){ ?> <?php echo stripslashes($row['TW']); ?> <?php echo stripslashes($row['LW']); ?> //image or formatted RE <?php echo stripslashes($row['Wks']); ?> <?php echo stripslashes($row['Title']); ?> //upper case <?php echo stripslashes($row['Artist']); ?> <?php $i++; } ?> 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]
<?php echo strtoupper(ststripslashes($row['Title'])); //upper case ?>
[/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]
<?
if($row['LW']=='new') {
echo "";
}
elseif($row['LW']==0) {
echo "RE
}
?> //image or formatted RE[/php]
If you need anything else, let me know.
samaru
a.k.a inscissor
Team Colleague
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
Same type of thing here: if LW == 0 RE