defining a variable

From: Date: Sun, 27 Oct 2002 19:00:55 +0000
Subject: defining a variable
Groups: php.general 
Request: Send a blank email to php-general+get-121609@lists.php.net to get a copy of this message
Hi All, I am have trouble getting $address to print the URL that is in the db. <td class=\"dtd\"><a href=\"$address\" target=\"_blank\">%s</a></td> is printing the url with the word address instead of the real address. The code is below. $sql ="SELECT * FROM links ORDER BY owner";
           $sql_result = mysql_query($sql, $conn) or die ("couldn't Connect");
       while ($myrow = mysql_fetch_array($sql_result)){
$address = 'address';
    echo "<table width=\"100%\" border=\"0\"  cellpadding=\"2\" cellspacing=\"0\"  class=\"dtd\">\n";
echo"<tr>
    <td class=\"tlt\">Name</td>
    <td class=\"tlt\">Creator</td>
    <td class=\"tlt\">Category</td>
</tr>\n"; do { printf(" <tr>
    <td class=\"dtd\"><a href=\"$address\" target=\"_blank\">%s</a></td>
    <td class=\"dtd\">%s</td>
    <td class=\"dtd\">%s</td>
</tr>\n", $myrow['tutorial'], $myrow['owner'], $myrow['category']); }while ($myrow = mysql_fetch_array($sql_result)); echo"</table>"; }

« previous php.general (#121609) next »