0

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?

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by broj1
0

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>";
}

Edited by broj1: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.