Moved IIS servers now code not working.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JimiH
Forum Commoner
Posts: 92
Joined: Thu Jun 15, 2006 6:10 am

Moved IIS servers now code not working.

Post 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
Attachments
How form is displayed
How form is displayed
form.jpg (104.69 KiB) Viewed 198 times
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Re: Moved IIS servers now code not working.

Post 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;
JimiH
Forum Commoner
Posts: 92
Joined: Thu Jun 15, 2006 6:10 am

Re: Moved IIS servers now code not working.

Post 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
Post Reply