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. Link to comment https://forums.phpfreaks.com/topic/195797-query-display-problem/ 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 ... Link to comment https://forums.phpfreaks.com/topic/195797-query-display-problem/#findComment-1028557 Share on other sites More sharing options...
dsp77 Posted March 19, 2010 Author Share Posted March 19, 2010 thank you so much! Link to comment https://forums.phpfreaks.com/topic/195797-query-display-problem/#findComment-1028563 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.