You are here: Re: local works, but live doesnt. « All PHP « IT news, forums, messages
Re: local works, but live doesnt.

Posted by Kim Andrι Akerψ on 01/11/07 12:12

Dave Nash wrote:

> On Thu, 11 Jan 2007 12:57:00 +0100, Ruben van Engelenburg
> <nospam@nospam.com> wrote:
>
> > Dave Nash wrote:
> >
> >> $query = "select * from categories WHERE parentid = $catid";
> >> $result = mysql_query($query) or die ("Couldn't execute query: " .
> >> mysql_error());
> >> echo "$query";
> >>
> >> Table is categories
> >>
> >> CATID
> >> PARENTID
> >>
> >> Im trying to show all categories where the PARENTID value is the
> same >> as the CATID value.
> >
> > It could be that the variable $catid is empty, causing the query to
> > be invalid.
> > I'm not sure where $catid is being set in your script because you
> > didn't post that part, hence my question to echo the $query var.
> >
> > Ruben.
>
> CATID is being passed via a url
>
> list_subs.php?catid=53
>
> So catid should always be there.

Sure, if register_globals is set to "on" on both the local and live
servers. Rather, get used to using $_GET["catid"] instead of $catid.

--
Kim AndrΓ© AkerΓΈ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация