Re: [PHP] ID problem



On Wed, February 28, 2007 3:24 am, Delta Storm wrote:
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']; )

echo "id starsts as $id<br />\n";


And in index.php I have the following code:

while ($row = mysql_fetch_array($result))
{

echo "about to change id from '$id' to '$row[id]'<br />\n";

$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'";

echo $query, "<br />\n";

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

I really dont know what is the problem.

Just echo out each variable in turn until you are sure it's what you
think it is.

Somewhere along the way, one of them isn't.

Also turn on E_NOTICE so you'll find any typos.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
.



Relevant Pages

  • 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: 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: passing objects into methods that do database processing?
    ... I am working on a news section of a website. ... edit and delete news articles from the database. ... the helper class and probably the NewsItem object or data type depending how ... Date - DateTime (The date/time the news article was posted). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Dabbling in plain-text databases
    ... will be sort of a video game fansite, that will have a news page (news ... Mysql can be slower if you host's msyqlserver is overworked, but usually you won't see the difference. ... An sql based database is better for situations requiring better multi-posting and you get better tools for reading/updating/deleting entries. ...
    (comp.lang.php)
  • Developing ASP Pages For Display....
    ... >I developed the Access DBase to handle news articles ... I provide the news ... >database return page for wizard then created a pass thru ...
    (microsoft.public.frontpage.programming)