Querying Custom Table…?
-
I have a custom table called “author_sub9 in my wordpress database. I have read documentation, but can’t get this to work. I am sure this is something stupid…
I have the page live below, such that my “hello world” statement executes. I am using the default template. (Branford theme). I would appreciate any pointers, Thanks!
https://ulsandbox.org/bbtb10/?page_id=104
<?php echo "Hello World"; $query = "SELECT author_sub9.Sid, author_sub9.author_lname, author_sub9.author_fname, author_sub9.title, author_sub9.genre, author_sub9.approved FROM author_sub9 WHERE author_sub9.approved = 1 ORDER BY author_sub9.genre,author_sub9.author_lname";?> <h1> 2009 Authors List</h1> <h3> Click on each author to read more about them</h3> <p> </p> <hr align="left" width="75%"> View Categories:<p><a href="#childrens">Childrens</a> | <a href="#fiction">Fiction</a> | <a href="#non-fiction">Non-Fiction</a> | <a href="#teen">Teen</a> | <a href="#other">Other</a></p> <p> </p> <?php $sLastGenre=''; $Result = mysql_query($query, $bbtb1) or die(mysql_error()); while ($Row = mySql_fetch_array ($Result)) { if ($Row['genre']!=$sLastGenre) { if ($sLastGenre != '') echo '</table>'; echo '<br /><h1> <a name="'.$Row['genre'].'">'.$Row['genre'].'</a></h1><br /><table width=\"100%\" class=at>'; $sLastGenre=$Row['genre']; } //original echo '<tr><td width=\"40%\">'.'<a href=\"#\"'.$Row['author_name'].'</td><td>'. $Row['title'].'</td></tr>'; echo '<tr><td class=aname>'.'<a href="authordetail.php?recordID='.$Row['Sid'].'">'.$Row['author_lname'].', '.$Row['author_fname'].'</a></td><td>'. $Row['title'].'</td></tr>'; } if ($sLastGenre != '') echo '</table>'; ?>
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Querying Custom Table…?’ is closed to new replies.