Page 1 of 1

Moved IIS servers now code not working.

Posted: Thu Jan 24, 2008 3:42 am
by JimiH
hello

We recently moved our iis server to a new one, now something has broken.

All the reports still work so the connection with mysql is not the problem, the problem is
with a number of dropdown boxes linked to different tables within the mySql database.

Connection.php script

Code: Select all

$localhost = 'localhost';
$user='root';
$pass='root';
$Database='vsi_projects';
$link = mysql_connect($localhost, $user, $pass);
$connection=mysql_connect("$localhost","$user","$pass") or die("I Couldn't connect");
 
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db($Database) or die(mysql_error()); 
 

Query code within form

Code: Select all

          <?
        include("connect.php");
      
          $mode=$_GET["mode"];
          if($mode=="add") {
    
$my_query = mysql_query ("SELECT * FROM email_sales_man;") or die ("failed"); 
$my_query2 = mysql_query ("SELECT * FROM engineer;") or die ("failed"); 
$my_query3 = mysql_query ("SELECT * FROM projectmembers;") or die ("failed"); 
 
 
          ?>
 
Dropdown field code

Code: Select all

    
    echo"<select name=\"ENGINEER\">"; 
    while($row=mysql_fetch_assoc($my_query2)) 
    { 
    echo  "<option value=\"".$row['email']."\">".$row['email']."</option>"; 
    
    } 
 
The dropdown field on the form has "; while($row=mysql_fetch_assoc($my_query2)) { echo "".$row['email'].""; } ?> " instead of the results from the query.
If I directly connect to the DB and run the query the results are displayed so the query string is correct.

Hope you can help

thanks

Geoff

Re: Moved IIS servers now code not working.

Posted: Thu Jan 24, 2008 3:57 am
by Rovas
It' s a problem with the MySQL server. Check the log files for IIS server and run the queries on your MySQL server (directly) hopefully you' ll find the problem.
EDIT: Run the part of the script separately, see the results, check for errors;

Re: Moved IIS servers now code not working.

Posted: Thu Jan 24, 2008 4:47 am
by JimiH
Hello, the sql server was fine with the querys

I fixed it by replacing "<?" with "<?php" on that page do you know why that is?
dont want to replace every instance of "<?" with "<?php"

Any ideas

Thanks

Geoff