dsp77 Posted March 19, 2010 Share Posted March 19, 2010 i have this code: <?php $query1="select * from performancecriteria where project_id = '$project' and type = 1 order by year"; $result1=mysql_query($query1) or die("can not make query1 ". mysql_error()); $row = @mysql_fetch_row($result1); while( $row ) { echo'<tr>'; echo'<td style="border: 1px dotted #000;" align="center">'; echo'  '.$row[2].''; echo'</td>'; echo'<td style="border: 1px dotted #000; padding:5px;" align="left">'; echo'Nr. <input style="width:20px;margin-left:46px;margin-bottom:5px;text-align:center;" type="text" name="totalValue'.$row[0].'" id="totalValue'.$row[0].'" value="'.$row[1].'" maxlength="2"></input><br />'; echo'Reviste* : <input style="width:380px;" type="text" name="totalISI'.$row[0].'" id="totalISI'.$row[0].'" value="'.$row[3].'"></input>'; echo'</td>'; echo'</tr>'; $row = @mysql_fetch_row($result1); } ?> it echoes a table with years 2009 2010 2011 echo'  '.$row[2].''; and i want to add 2 asteriks just to the year 2010 if i do echo'  '.$row[2].'**'; it will appear to all 3 years. please help. Quote Link to comment Share on other sites More sharing options...
Jax2 Posted March 19, 2010 Share Posted March 19, 2010 Why not use a simple if/else statement? Kind of like this: if ($row[2]=="2010") { echo'  '.$row[2].'***'; } ELSE { echo'  '.$row[2].''; }; That should work ... Quote Link to comment Share on other sites More sharing options...
dsp77 Posted March 19, 2010 Author Share Posted March 19, 2010 thank you so much! 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.