473,499 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2179

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2243
by: Duane Winner | last post by:
Hello all - I'm having a small problem with the mysql startup script that ships with MySQL-3.23.56-1. I'm running on RedHat Linux. It works fine, but I have a backup server that runs a script...
0
1536
by: Tiffany Wilkes | last post by:
I solved the problem--I needed ( ) around the column list. I think the manual should make that more clear. -------- Original Message -------- Subject: column privilege problem Date: Tue, 05...
0
1318
by: Annie Xie | last post by:
1> anyone has a compiled tarball for mysql new version (-4.0 up) for solaris 2.6 can be shared? The OS was patched latest. 2> I'm trying build it, configure w/o any problem. However, when dong...
0
624
by: Gary Cote | last post by:
>Description: I've recently compiled mysql 4.0.14 on redhat 8.0. The installation fails, however, when running mysql_install_db. I've attached a transcript below. I gather from searching the...
4
4467
by: Amadeus | last post by:
Hello Everybody! I have a problem with MySQL servers running RedHat 9 (smp kernel 2.4.20) on Intel and MySQL server 4.0.14 (problem also appears on binary distr 4.0.15 and on 4.0.15 I bilt myself...
1
3606
by: smsabu2002 | last post by:
Hi, I am facing the build problem while installing the DBD-MySql perl module (ver 2.9008) using both GCC and CC compilers in HP-UX machine. For the Build using GCC, the compiler error is...
1
6195
by: Lynton Towler | last post by:
Hello and thanks for reading this message. I have a Virtual Learning Environment (VLE) called "moodle 1.5.2" running on a server with 1Gb of RAM and MySQL version 4.1.13-1 which has been...
3
6072
by: Juan Antonio Villa | last post by:
Hello, I'm having a problem replicating a simple database using the binary log replication, here is the problem: When the master sends an update to the slave, an example update reads as follows:...
4
7373
jepler
by: jepler | last post by:
I find myself in a circular reference loop that I can't seem to resolve. I recently upgraded from MySQL 4.0.x to MySQL 4.1.21 on OS 10.3.9 Server. Then, I *thought* I set my open master root password...
8
2758
by: geert | last post by:
Hi all, I have a mac mini running maocosx 10.5 leopard I want to deploy a django project on. My backend is MySQL, and I have it running as a 64- bit app. Of course, apache2 is also running as...
0
7131
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.