471,071 Members | 6,743 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,071 software developers and data experts.

problem with php mysql iis

Hi
I have one page: index.php - news portal - with headlines, every headline is
a link to whole news , and the code is like this:
....
$news_id=$row["news_id"];
echo "<a href='news.php?news_id=$news_id'>
....

the other page -news.php- that shows that news looks like this:
....
<?php
$result = mysql_query("select * from news WHERE
news_id='$news_id'") or
die (mysql_error());
while ($row = mysql_fetch_array($result))
.....

and this works fine on the Internet (PHP/MySQL/Apache)
but locally, I tried the same thing, and it doesn't work - but on
PHP/MySQL/IIS

it seems like it doesn't bring $news_id to sql query... is this a IIS
problem or what?

thanks for any help
Vyeran
Oct 6 '06 #1
5 2113

Vjeran wrote:
Hi
I have one page: index.php - news portal - with headlines, every headline is
a link to whole news , and the code is like this:
...
$news_id=$row["news_id"];
echo "<a href='news.php?news_id=$news_id'>
...

the other page -news.php- that shows that news looks like this:
...
<?php
$result = mysql_query("select * from news WHERE
news_id='$news_id'") or
die (mysql_error());
while ($row = mysql_fetch_array($result))
....

and this works fine on the Internet (PHP/MySQL/Apache)
but locally, I tried the same thing, and it doesn't work - but on
PHP/MySQL/IIS

it seems like it doesn't bring $news_id to sql query... is this a IIS
problem or what?

thanks for any help
Vyeran
What is the error?

Oct 6 '06 #2

"Vjeran" <vp******@MAKNIfoi.hrwrote in message
news:eg**********@ss408.t-com.hr...
Hi
I have one page: index.php - news portal - with headlines, every headline
is
a link to whole news , and the code is like this:
...
$news_id=$row["news_id"];
echo "<a href='news.php?news_id=$news_id'>
...

the other page -news.php- that shows that news looks like this:
...
<?php
$result = mysql_query("select * from news WHERE
news_id='$news_id'") or
die (mysql_error());
while ($row = mysql_fetch_array($result))
....

and this works fine on the Internet (PHP/MySQL/Apache)
but locally, I tried the same thing, and it doesn't work - but on
PHP/MySQL/IIS

it seems like it doesn't bring $news_id to sql query... is this a IIS
problem or what?

thanks for any help
Vyeran

perhaps: relying on register globals to get $news_id in place of
$news_id = $_GET['news_id']
Oct 6 '06 #3
["Followup-To:" header set to comp.lang.php.]
Vjeran wrote:
<?php
$result = mysql_query("select * from news WHERE
news_id='$news_id'") or
die (mysql_error());
while ($row = mysql_fetch_array($result))
....
It appears you have register_globals on.
http://php.net/register_globals

*Turn it off!*

And change your code to:

<?php
$result = mysql_query("select * from news WHERE news_id='".$_GET['news_id']."'") or die (mysql_error());
...
Happy Coding :)
--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot
Oct 6 '06 #4
thank you Pedro and Johnny, it's working now...

"Pedro Graca" <he****@dodgeit.comwrote in message
news:sl*******************@ID-203069.user.individual.net...
["Followup-To:" header set to comp.lang.php.]
Vjeran wrote:
><?php
$result = mysql_query("select * from news WHERE
news_id='$news_id'") or
die (mysql_error());
while ($row = mysql_fetch_array($result))
....

It appears you have register_globals on.
http://php.net/register_globals

*Turn it off!*

And change your code to:

<?php
$result = mysql_query("select * from news WHERE
news_id='".$_GET['news_id']."'") or die (mysql_error());
...
Happy Coding :)
--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

Oct 6 '06 #5
Vjeran wrote:
thank you Pedro and Johnny, it's working now...

"Pedro Graca" <he****@dodgeit.comwrote in message
news:sl*******************@ID-203069.user.individual.net...
>["Followup-To:" header set to comp.lang.php.]
Vjeran wrote:
>><?php
$result = mysql_query("select * from news WHERE
news_id='$news_id'") or
die (mysql_error());
while ($row = mysql_fetch_array($result))
....
It appears you have register_globals on.
http://php.net/register_globals

*Turn it off!*

And change your code to:

<?php
$result = mysql_query("select * from news WHERE
news_id='".$_GET['news_id']."'") or die (mysql_error());
...
Happy Coding :)
--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

.... but as I said to somebody else,

"doesn't work" doesn't tell us anything!

Colin
Oct 6 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Duane Winner | last post: by
reply views Thread by Tiffany Wilkes | last post: by
reply views Thread by Annie Xie | last post: by
reply views Thread by Gary Cote | last post: by
1 post views Thread by Lynton Towler | last post: by
3 posts views Thread by Juan Antonio Villa | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.