atom feed2 messages in com.googlegroups.professional-phpRe: [Pro. PHP Dev.] Re: php problem
Subject:Re: [Pro. PHP Dev.] Re: php problem
From:♥ Ѐ ÕÑê & ÕÑ£¥ Thãñj襧 Hè®è ♥ (than@gmail.com)
Date:Dec 25, 2007 9:26:53 pm
List:com.googlegroups.professional-php

On 23/12/2007, ♥ Ѐ ÕÑê & ÕÑ£¥ Thãñj襧 Hè(R)è ♥ <than@gmail.com> wrote: Hii , mathew.

whether u problem solved or not..???

HII,

I also used this way but some problems occur .then i tried another method like foreach .... if u send your mysql database sql(export database and send to my mail).then i wil help u ...............

On 23/12/2007, yellowmarker.co.uk <matt@gmail.com > wrote:

I was curious about this so I implement the page and created the two database tables with some test data... which confirmed that the code/ loop works.

I believe the reason why you received 4 "No Entries" messages is because you refer to having "one post with an id of 3" when you should have had "one post with a cat_id of 3" to do a successful test of the page.

On Dec 19, 4:30 pm, James <tria@gmail.com> wrote:

Hi, Im coding a page to display all posts from a certain category and Im having trouble making it work. The url that is passed on to this page (viewcat.php) is viewcat.php?id=3. Anyways when I load the page I get 4 "No Entries" in a list. There are 4 different entries in my database but Im not sure how this is affecting it. I have one post with an id of 3. Is there something wrong with the loop I made?

<?php require("header.php"); require(" config.php"); if(isset($_GET['id']) == TRUE) { if(is_numeric($id) == FALSE) { $error = 1;}

if($error == 1) { header("Location: " . $config_basedir . "/viewcat.php");}

else { $validcat = $_GET['id'];} }

else { $validcat = 0;}

$sql = "SELECT * FROM catagories"; $result = mysql_query($sql); while($row = mysql_fetch_assoc($result)) { if($validcat == $row['id']) { echo "<strong>" . $row['cat'] . "</strong><br />"; $entriessql = "SELECT * FROM entries WHERE cat_id = " . $validcat . " ORDER BY dateposted DESC;"; $entriesres = mysql_query($entriessql); $numrows_entries = mysql_num_rows($entriesres); echo "<ul>"; if($numrows_entries == 0) { echo "<li>No entries!</li>";}

else { while($entriesrow = mysql_fetch_assoc($entriesres)) { echo "<li>" . date("D jS F Y g.iA", strtotime($entriesrow['dateposted'])) ." - <a href=' viewentry.php? id=" . $entriesrow['id'] . "'>" .$entriesrow['subject'] ."</a></li>";} } echo "</ul>"; } }

require("footer.php"); ?>

Thanks,

•°¤*(¯`°(ßåché£Ø(R) Õƒ §oftwå(R)ê §è(R)v좣)°´¯)*¤°•

•°¤*(¯`°(ßåché£Ø(R) Õƒ §oftwå(R)ê §è(R)v좣)°´¯)*¤°•