variable within a $row variable

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mrlayance
Forum Commoner
Posts: 31
Joined: Mon Dec 07, 2009 11:53 am

variable within a $row variable

Post by mrlayance »

Not sure why this does not work?

Code: Select all

while($row = mysql_fetch_array($resultyes))
  {
 
  echo "<tr>";
  echo "<td>" . $row['$software'] . "</td>";
  echo "</tr>";
  }
Everything else calling the $software variable works within the code.

Results are blank?
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: variable within a $row variable

Post by AbraCadaver »

http://us2.php.net/manual/en/language.types.string.php

Read the single and double quotes sections.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
mrlayance
Forum Commoner
Posts: 31
Joined: Mon Dec 07, 2009 11:53 am

Re: variable within a $row variable

Post by mrlayance »

Thanks, darn double quotes.
Post Reply