PDA

View Full Version : Clickable


Arsench
09-26-2007, 01:15 PM
Hi I have a db and want to show it and that be a click able.There are 2 ways

1.just be a click able the url
2.do description click able and url for description be the url from the same db

here are a link

http://www.khaarsen.com/Paid_to_click.php
and here the code:
<?php

dnuser password and etc here

$db = mysql_connect(localhost,$username,$password);
mysql_select_db($database) or die( "Unable to select database");

$sql = 'SELECT * FROM `paid` ORDER BY pname DESC';
$result=mysql_query($sql);

?>
</div>
<TABLE bordercolordark="#FF0000" BORDER=1 align="center" CELLPADDING=0 CELLSPACING=0>
<TR >
<TD><div align="center"><span class="style3">&nbsp;Name</span></div></TD>
<TD ><div align="center"><span class="style3">&nbsp;Description&nbsp;</span></div></TD>
<TD ><div align="center"><span class="style3">&nbsp;Url&nbsp;</span></div></TD>
</TR>

<?php

while($row = mysql_fetch_array($result)) {
printf("<tr><td >&nbsp;%s</td><td>&nbsp;%s</td><td >&nbsp;%s</td></tr>",
$row["pname"],$row["pdesc"],$row["purl"]);
}


mysql_free_result($result);
mysql_close();


?>


please help

Jaanboy
09-26-2007, 02:12 PM
Change:printf("<tr><td >&nbsp;%s</td><td>&nbsp;%s</td><td >&nbsp;%s</td></tr>",
$row["pname"],$row["pdesc"],$row["purl"]);

To:printf("<tr><td >&nbsp;%s</td><td>&nbsp;%s</td><td >&nbsp;<a href="%s">Click</a></td></tr>",
$row["pname"],$row["pdesc"],$row["purl"]);