ondi Posted May 17, 2009 Share Posted May 17, 2009 Here's a snippet of my code. I can't for the life of me work out where to put the font size instruction, could someone point me in the right direction? Thanks $sort = isset($_GET['sort2']) ? $_GET['sort2'] : 'season_name'; if( !in_array($sort,array('season_name','games','won','lost','draw','winpct')) ) $sort = 'season_name'; $query .= " ORDER BY " . $sort . " ASC"; $rst = mysql_query($query); echo mysql_error(); $j=1; $tmp = "<b>%s</b>"; while( $r = mysql_fetch_array($rst) ) { if( ($j++) % 2 == 0) $temp = "$bg1"; else $temp = "$bg2"; echo" <tr> <td align=\"left\" valign=\"middle\" bgcolor=\"$temp\"> {$r[season_name]} </a> </td> <td align=\"center\" valign=\"middle\" font face=\"Arial\" size=\"1\" bgcolor=\"$temp\">"; printf( ($sort == 'games'?$tmp:"%s"), $r['games'] ); echo "</td> <td align=\"center\" valign=\"middle\" bgcolor=\"$temp\">"; printf( ($sort == 'won'?$tmp:"%s"), $r['won'] ); echo "</td> <td align=\"center\" valign=\"middle\" bgcolor=\"$temp\">"; printf( ($sort == 'draw'?$tmp:"%s"), $r['draw'] ); echo "</td> <td align=\"center\" valign=\"middle\" bgcolor=\"$temp\">"; printf( ($sort == 'lost'?$tmp:"%s"), $r['lost'] ); echo "</td> <td align=\"center\" valign=\"middle\" bgcolor=\"$temp\">"; printf( ($sort == 'winpct'?$tmp:"%s"), $r['winpct'] ); echo"</td> </tr> \n"; $games += $r['games']; $won += $r['won']; $draw += $r['draw']; $lost += $r['lost']; } ?> Here's the font code which i've been trying to use... font size=\"1\" Quote Link to comment https://forums.phpfreaks.com/topic/158481-cant-change-font-size-within-php-code/ Share on other sites More sharing options...
DarkSuperHero Posted May 17, 2009 Share Posted May 17, 2009 Your going to need to change...problem is you have a space between font and face...and i dont think thats a valid attribute either... ... font face=\"Arial\" size=\"1\" bgcolor=\"$temp\" .... those portions and use some inline CSS...looks like you might be confusing some of these attributtes for this... style=\"font-family:Arial;font-size:small;background-color:$temp\" Quote Link to comment https://forums.phpfreaks.com/topic/158481-cant-change-font-size-within-php-code/#findComment-835809 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.