Thread: Sorting a SUM
View Single Post
Old 01-18-2013, 04:55 PM   PM User | #25
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
You don't wrap it in quotes like that as if that would parse it would be <img src="'ALT'.png"/> which isn't correct. You simply use: <?php echo '<img src="' . $team_id . '.png" alt=""/>';. It must be echoed through PHP if you want to parse a variable.
If you do this though, I'd suggest not using the $team_id and using a second variable, or not running $team_id through mysql_real_escape_string until its used within the query. Then you should use urlencode on the $team_id within the img tag in case it contains characters that need to be interpreted differently such as a space.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote