problem with php mysql iis

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vjeran

    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_i d'>
    ....

    the other page -news.php- that shows that news looks like this:
    ....
    <?php
    $result = mysql_query("se lect * from news WHERE
    news_id='$news_ id'") or
    die (mysql_error()) ;
    while ($row = mysql_fetch_arr ay($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


  • iulian.ilea

    #2
    Re: problem with php mysql iis


    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_i d'>
    ...
    >
    the other page -news.php- that shows that news looks like this:
    ...
    <?php
    $result = mysql_query("se lect * from news WHERE
    news_id='$news_ id'") or
    die (mysql_error()) ;
    while ($row = mysql_fetch_arr ay($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?

    Comment

    • Johnny

      #3
      Re: problem with php mysql iis


      "Vjeran" <vperinov@MAKNI foi.hrwrote in message
      news:eg4r1l$4lv $1@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_i d'>
      ...
      >
      the other page -news.php- that shows that news looks like this:
      ...
      <?php
      $result = mysql_query("se lect * from news WHERE
      news_id='$news_ id'") or
      die (mysql_error()) ;
      while ($row = mysql_fetch_arr ay($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']


      Comment

      • Pedro Graca

        #4
        Re: problem with php mysql iis

        ["Followup-To:" header set to comp.lang.php.]
        Vjeran wrote:
        <?php
        $result = mysql_query("se lect * from news WHERE
        news_id='$news_ id'") or
        die (mysql_error()) ;
        while ($row = mysql_fetch_arr ay($result))
        ....
        It appears you have register_global s on.


        *Turn it off!*

        And change your code to:

        <?php
        $result = mysql_query("se lect * from news WHERE news_id='".$_GE T['news_id']."'") or die (mysql_error()) ;
        ...


        Happy Coding :)
        --
        File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

        Comment

        • Vjeran

          #5
          Re: problem with php mysql iis

          thank you Pedro and Johnny, it's working now...



          "Pedro Graca" <hexkid@dodgeit .comwrote in message
          news:slrneic7nl .dls.hexkid@ID-203069.user.ind ividual.net...
          ["Followup-To:" header set to comp.lang.php.]
          Vjeran wrote:
          ><?php
          >$result = mysql_query("se lect * from news WHERE
          >news_id='$news _id'") or
          > die (mysql_error()) ;
          >while ($row = mysql_fetch_arr ay($result))
          >....
          >
          It appears you have register_global s on.

          >
          *Turn it off!*
          >
          And change your code to:
          >
          <?php
          $result = mysql_query("se lect * from news WHERE
          news_id='".$_GE T['news_id']."'") or die (mysql_error()) ;
          ...
          >
          >
          Happy Coding :)
          --
          File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

          Comment

          • Colin Fine

            #6
            Re: problem with php mysql iis

            Vjeran wrote:
            thank you Pedro and Johnny, it's working now...
            >
            >
            >
            "Pedro Graca" <hexkid@dodgeit .comwrote in message
            news:slrneic7nl .dls.hexkid@ID-203069.user.ind ividual.net...
            >["Followup-To:" header set to comp.lang.php.]
            >Vjeran wrote:
            >><?php
            >>$result = mysql_query("se lect * from news WHERE
            >>news_id='$new s_id'") or
            >> die (mysql_error()) ;
            >>while ($row = mysql_fetch_arr ay($result))
            >>....
            >It appears you have register_global s on.
            >http://php.net/register_globals
            >>
            >*Turn it off!*
            >>
            >And change your code to:
            >>
            > <?php
            > $result = mysql_query("se lect * from news WHERE
            >news_id='".$_G ET['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

            Comment

            Working...