Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5540

display url from custom WordPress table

$
0
0

Hi

I can display with the code below the rows from my mysql table I would like to display the url to open a specific page for each row with rewrite url (better than page.php?id=XXX)

Using if possible the post page template of WordPress

Thanks for your help

global $db;
$row = $db->get_results( "SELECT * FROM table1 order by Name");
foreach ( $row as $rows ) 
{
echo '<a href="'.$rows->Name.'-'.$rows->ID.'">'.$rows->Name.'</a><br />';
}

Viewing all articles
Browse latest Browse all 5540

Trending Articles