I am trying to create a url bookmark script for my own use.

Here's the code.

<?php

mysql_connect("localhost", "root", "") or die(mysql_error()); 
mysql_select_db("delicious") or die(mysql_error()); 
 
$data = mysql_query("SELECT * FROM stacks") or die(mysql_error()); 

if(mysql_num_rows($data)) {
echo '<table cellpadding="0" cellspacing="0" class="db-table">';
echo '<tr><th>No</th><th>Name</th><th>URL</th></tr>';

while($row2 = mysql_fetch_row($data)) 
 {
echo '<tr>';
foreach($row2 as $key=>$value) 
 {
echo '<td>',$value,'</td>';
 }
echo '</tr>';
}
echo '</table><br />';
}

?>

I am not sure how to make it clickable. Any ideas?

Recommended Answers

All 2 Replies

<a href="url">Link title</a>
us this html tag for hyper link.

Hopefuly you have the URL for each bookmark in the table (bookmark_url and bookmark_text fields as an example below).

// echo table rows
while($row2 = mysql_fetch_row($data)) {

    $bookmark_url = $row2['bookmark_url'];
    $bookmark_text = $row2['bookmark_text']

    echo "<tr><td><a href=\"$bookmark_url\">$bookmark_text</a></td></tr>";
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.