472,985 Members | 2,953 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,985 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 2164

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
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
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
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
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
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
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
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
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
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
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
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.