Re: [PHP] ID problem



2007. 02. 28, szerda keltezéssel 10.24-kor Delta Storm ezt írta:
Hi,

I'm building an CMS system (for practice and experience :)).

And of course like many times before I have encountered a problem.

The problem is:

I have a index.php that takes the news from the database and publishes
them. And by the end of every news on index.php I have a link ('<a
href="showfullnews.php?id=$id">Show full news</a>')

That leads to a page that has the full news.

At the beginning of showfullnews i have a variable ( $id = $_GET['id']; )

And in index.php I have the following code:

while ($row = mysql_fetch_array($result))
{
$id= $row['id'];
etc...
}

In the database I have two tables one for a short version of news for
index.php and another for fullNews.

In full news the query is: "select title,newsFull from fullnews where
id='$id'";

In the database i'm 100% sure there is a id = 1 in both rows.

I really dont know what is the problem.

ehh, what is the problem? you didn't tell.
I guess that the fullnews page don't display the news correctly, right?
if so, please show us the code of that page

btw, why are you using two tables?
everything could be put in one with fields like title,shorttext,fulltext
and so on...
and then there would be only one id for one article, which could reduce
confusion and eliminate some possible problems

hope that helps
Zoltán Németh

Thank you very much!

.



Relevant Pages

  • ID problem
    ... I'm building an CMS system (for practice and experience:)). ... I have a index.php that takes the news from the database and publishes them. ... In the database I have two tables one for a short version of news for index.php and another for fullNews. ...
    (php.general)
  • Re: [PHP] ID problem
    ... On Wed, February 28, 2007 3:24 am, Delta Storm wrote: ... I have a index.php that takes the news from the database and publishes ... index.php and another for fullNews. ...
    (php.general)
  • Re: Dabbling in plain-text databases
    ... plain-text databases (and if they're worth using in lieu of sql). ... will be sort of a video game fansite, that will have a news page (news ... parsing a file like that any faster or slower than using MySQL? ... An sql based database is better for situations requiring  better ...
    (comp.lang.php)
  • Re: OT--WILL SOMEONE TELL THESE FARTHEADED MORONS TO GET OFF OF THE "MORE NEWS YOU WONT SEE
    ... it's sort of like the question about how you get to Carnegie ... unless they practice, practice, practice? ... yesterday and I don't think any of it made the cut for the evening news ... The DOD news release on the Iraqi Air Farce did make some ...
    (rec.outdoors.rv-travel)
  • Re: Dabbling in plain-text databases
    ... plain-text databases (and if they're worth using in lieu of sql). ... will be sort of a video game fansite, that will have a news page (news ... parsing a file like that any faster or slower than using MySQL? ... An sql based database is better for situations requiring better ...
    (comp.lang.php)