Luke
30-05-2011, 08:33 PM
Right, not sure how to explain, but litterally:
MYSQL table, news storys:
Website, "tab display", want 3 most recent stories.
I know how to list them, but not how to do it with the tabs, because of the way they're coded.. can anyone help me out?
Here's an idea of what i want, with examples if there was only one
<?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['shortstory']; ?></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>
MYSQL table, news storys:
Website, "tab display", want 3 most recent stories.
I know how to list them, but not how to do it with the tabs, because of the way they're coded.. can anyone help me out?
Here's an idea of what i want, with examples if there was only one
<?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['shortstory']; ?></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>