Jump to content

LukeBateson

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by LukeBateson

  1. Oh, Doesn't matter: got it! Thanks!
  2. Thanks! That works, except, the ">" arrow doesn't show anytime..
  3. I can't get my head around it, no matter how many tutorials I read.. So would anyone be able to put this code into a pagination of 3 per page? Many Thanks <?php if(!$_GET['id']) { $query = "SELECT * FROM news where published = '1' ORDER by id DESC"; $result = mysql_query($query) or die(mysql_error()); $news = mysql_fetch_assoc($result); ?> <?php do { ?> <table width="590" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"><h2><? echo $news['title']; ?></h2></td> </tr> <tr> <td width="398"><? echo $news['story']; ?></td> <td width="192"><img src="<? echo $news['image']; ?>" alt="<? echo $news['shortstory']; ?>" width="192" height="108" /></td> </tr> <tr> <td colspan="2"><i><br /> Posted by <? echo $news['author']; ?> on <? echo $news['date']; ?></i></td> </tr> </table><br /> <?php } while ($news = mysql_fetch_assoc($result)); } ?>
  4. I got this error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/lukebate/public_html/**/includes/functions.php on line 68 Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/lukebate/public_html/**/includes/functions.php on line 70
  5. Right, it's hard to explain, but I'll try my best. Litterally, I have a 'tab' box on my homepage. And a table called 'news'. Now, the table has the rows "shorttitle" "shortstory" and "image" in it. I want the title the three latest titles to be on the three tabs, and the story and image in the respective content areas. (The table auto increments the ID, and so order by ID descending limit of 3 yes?) Now, the code for the tabs is: <?php $query = "SELECT * FROM news where published = '1' ORDER by id DESC LIMIT 3"; $row_news = mysql_fetch_array($query); ?> <div id="myTabs"> <ul> <li><a href="#firsttab"></a><? echo $row_news['shorttitle']; ?></li> <li><a href="#secondtab">newsID2</a></li> <li id="last"><a href="#thirdtab">newsID3 </a></li> </ul> <div id="firsttab" class="tab_content"> <div class="rafat"> <img src="<? echo $row_news['image']; ?>" /> <p> <? echo $row_news['shortstory']; ?> </p> </div> </div> <div id="secondtab" class="tab_content"> <div class="rafat"> <img src="newsIMAGE2" /> <p> newsSTORY2 </p> </div> </div> <div id="thirdtab" class="tab_content"> <div class="rafat"> <img src="newsIMAGE3" /> <p> newsSTORY3 </p> </div> </div> </div> Now, i've filled in the first tab with the MYSQL queries, but i'm unsure how to fill in the other two, because of the way it's coded.. I can't do a 'repeating' code, because of the IDs of the divs, and the three tabs are bunched together.. Anyone any ideas? Much apreciated. Thanks Luke
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.