Page 1 of 1

Problem with IIS / PHP / MySQL

Posted: Mon Oct 26, 2009 12:59 am
by gavinh
Hi,
I have just installed PHP and MySQL on IIS 5.1 (throughout this problem I have tried multiple different versions of PHP and MySQL).

I copied the website and the DB I was working on, and it worked correctly, was registering new users to the DB, retrieving data etc. Howveer one of the functions of the site is to insert information into the DB and it is not working, I am getting the failure response each time. I know the code works fine as I have tested it on wampserver on my laptop, and also I have tested it online (the site is going onto the LAN in work so I need to use IIS).

I am hoping someone can point out where I have gone wrong in setting it up?

I have the relevant code below, however this exact code is working fine on multiple different servers (albeit all Apache servers)

I really hope someone can point out what I have done wrong in the setup. All of the other functionality driven by the DB seems to be working fine, and I have PHPmyadmin working fine etc too.

Code: Select all

 
/* Include Files *********************/
session_start(); 
include 'library/config.php';
include 'library/opendb.php';
 
include("logon.php");
/*************************************/
 
$title   = $_POST['title'];
$emeraldstandard  = $_POST['emeraldstandard'];
$emeraldexpress  = $_POST['emeraldexpress'];
$emeraldpro  = $_POST['emeraldpro'];
$emeraldpayflow   = $_POST['emeraldpayflow'];
 
if(!isset($_POST['license'])){ 
    $license  = 'no';
}
else if (isset($_POST['license'])&&$_POST['license']=="yes"){
    $license = 'yes';
}
if(!isset($_POST['certified'])){ 
    $certified  = 'no';
}
else if (isset($_POST['certified'])&&$_POST['certified']=="yes"){
    $certified  = 'yes';
}
if(!isset($_POST['hosted'])){ 
    $hosted  = 'no';
}
else if (isset($_POST['hosted'])&&$_POST['hosted']=="yes"){
    $hosted  = 'yes';
}
$language  = $_POST['language'];
$demo  = $_POST['demo'];
$demouser  = $_POST['demouser'];
$demopass  = $_POST['demopass'];
 
 
    if(!get_magic_quotes_gpc())
    {
        $title   = addslashes($title);
        $emeraldstandard  = addslashes($emeraldstandard);
        $emeraldexpress  = addslashes($emeraldexpress);
        $emeraldpro  = addslashes($emeraldpro);
        $emeraldpayflow   = addslashes($emeraldpayflow);
        $modified  = addslashes($title);
        $hosted  = addslashes($hosted);
        $demo  = addslashes($demo);
        $demouser  = addslashes($demouser);
        $demopass  = addslashes($demopass);
    }
 
    $query = "INSERT INTO solutions (title, emeraldstandard, emeraldexpress, emeraldpro, emeraldpayflow, license, certified, hosted, demo, demouser, demopass, language) VALUES ('$title', '$emeraldstandard',  '$emeraldexpress', '$emeraldpro', '$emeraldpayflow', '$license', '$certified', '$hosted', '$demo', '$demouser', '$demopass', '$language')";
    mysql_query($query) or die('Error ,query failed');
 
?>
 
 

Re: Problem with IIS / PHP / MySQL

Posted: Mon Oct 26, 2009 3:54 am
by papa
Tough nut.

I recently installed php with IIS (though IIS 6) using SQL Server 2005. I used this tutorial:
http://peterguy.com/php/install_IIS6.html

Double check and see that everything looks ok.

Re: Problem with IIS / PHP / MySQL

Posted: Mon Oct 26, 2009 9:12 pm
by Doug G
I'd start with a phpinfo() and verify the necessary php modules are loaded properly.