daralee100
07-22-2007, 08:15 PM
As seen at this url: http://www.phpfreaks.com/forums/index.php/topic,149590.msg644302.html#msg644302
I've been having trouble with a certain script... If you can't see the forum above, I'll repost what I'm having trouble with...
Looking at this site: http://musica.clavis-sama.com/ttcg/members.php
Things aren't showing up how they SHOULD appear...
Basically, it's written so that in one of the table boxes it's a button that links with the info from the database I.E.:
$link = "<a href='$row[siteurl]'><img src='$row[urlbanner]'>";
Should bring up a link with the siteurl from the database as the link and the urlbanner variable as the image... Do these need the single quote around them as well? They're called in by:
$sql = "SELECT username,siteurl,urlbanner FROM exchange";
And used as:
echo "<table border=0 cellspacing=0 cellpadding=2 width=200>";
echo "<tr><td>Site Banner<td>Owner";
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
echo "<tr><td>";
printf ("%s $td $link %s $el", $row[0], $row["username"]);
Which also should show the username in the correct area. The full coding is:
<?php
$connection = mysql_connect('sql06.freemysql.net','daralee100','*******');
$db = mysql_select_db('tcglinking', $connection);
$sql = "SELECT username,siteurl,urlbanner FROM exchange";
$result = mysql_query($sql);
$link = "<a href='$row[$siteurl]'><img src='$row[urlbanner]'></a>";
//uncomment $link and $el if you want it linkable
$td = "<td>";
echo "<table border=0 cellspacing=0 cellpadding=0 width=200>";
echo "<tr><td>Site Banner<td>Owner";
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
echo "<tr><td>";
printf ("%s $td $link", $row[0], $row["username"]);
}
mysql_free_result($result);
?>
Can anyone help me on this?
I've been having trouble with a certain script... If you can't see the forum above, I'll repost what I'm having trouble with...
Looking at this site: http://musica.clavis-sama.com/ttcg/members.php
Things aren't showing up how they SHOULD appear...
Basically, it's written so that in one of the table boxes it's a button that links with the info from the database I.E.:
$link = "<a href='$row[siteurl]'><img src='$row[urlbanner]'>";
Should bring up a link with the siteurl from the database as the link and the urlbanner variable as the image... Do these need the single quote around them as well? They're called in by:
$sql = "SELECT username,siteurl,urlbanner FROM exchange";
And used as:
echo "<table border=0 cellspacing=0 cellpadding=2 width=200>";
echo "<tr><td>Site Banner<td>Owner";
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
echo "<tr><td>";
printf ("%s $td $link %s $el", $row[0], $row["username"]);
Which also should show the username in the correct area. The full coding is:
<?php
$connection = mysql_connect('sql06.freemysql.net','daralee100','*******');
$db = mysql_select_db('tcglinking', $connection);
$sql = "SELECT username,siteurl,urlbanner FROM exchange";
$result = mysql_query($sql);
$link = "<a href='$row[$siteurl]'><img src='$row[urlbanner]'></a>";
//uncomment $link and $el if you want it linkable
$td = "<td>";
echo "<table border=0 cellspacing=0 cellpadding=0 width=200>";
echo "<tr><td>Site Banner<td>Owner";
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
echo "<tr><td>";
printf ("%s $td $link", $row[0], $row["username"]);
}
mysql_free_result($result);
?>
Can anyone help me on this?