ID:               48233
 Updated by:       johan...@php.net
 Reported By:      ralphyz at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         IIS related
 Operating System: W2K3 SP2
 PHP Version:      5.2.9
 New Comment:

When using the mysqli extension together with the mysql extension
you have to use the same libraries and include files. mysqli
extension requires the location of mysql_config file, mysql
extension requires the path of your mysql installation.

If you installed MySQL 4.1 for example with prefix /usr/local/mysql-4.1
your configure settings should be
--with-mysql=/usr/local/mysql-4.1
--with-mysqli=/usr/local/mysql-4.1/bin/mysql_config

I case that is correct please check your log files for more verbose
error messages.


Previous Comments:
------------------------------------------------------------------------

[2009-05-11 14:08:54] ralphyz at gmail dot com

Description:
------------
I get "The Page Cannot Be Displayed" error message when there are 3
print statements in a row which display the contents of an array (which
only has 1 column, and 3 rows).  When I comment out any of the three
print statements, the page displays without a problem.  

I tested this code on Ubuntu - and it works without a problem.

Also commenting out any of the following three lines makes this work
without a problem:
    print ("id: $id <BR>");
    print ("name:" . $name . "<BR>");
    print ("description:" . $description . "<BR>");

If I comment out any of those lines, but replace the "IF" statement
with a "FOR" statement to run through all my records ($num_rows = 31), I
get the same error (The Page Cannot Be Displayed).

The print statements with "got here" in them seem to have no negative
effect on the script.

Reproduce code:
---------------
<?php

$DBHost = "x.x.x.x";            // IP-address of MySQL server
$DBLogin = "username";          // Username of MySQL user
$DBPassword = "password";       // Password of MySQL user
$DBDatabase = "database";       // Name of database
$db_error = "";

$sql = "select A, B, C from employee";

$data_set = get_data($sql);

$num_rows = mysql_num_rows($data_set);

if($num_rows > 0)
{
     $row = mysql_fetch_array($data_set, MYSQL_NUM);

      $id = $row[0];
      $name = $row[1];
      $description = $row[2];

    print ("id: $id <BR>");
    print ("name:" . $name . "<BR>");
    print ("description:" . $description . "<BR>");

print ("got here");
print ("got here");
print ("got here");
print ("got here");
print ("got here");
print ("got here");
print ("got here");
print ("got here");
print ("got here");
print ("got here");
}


function get_data($sql)
{
      global $DBHost, $DBLogin, $DBPassword, $DBDatabase, $db_error;

      if(!mysql_connect("$DBHost", "$DBLogin", "$DBPassword"))
      {
        return "$db_error";
      }
      else
      {
        mysql_select_db("$DBDatabase");
        return mysql_query($sql);
      }
}
?>

Expected result:
----------------
This should display:

  1
  John Smith
  Staff
  got heregot heregot heregot heregot heregot heregot heregot heregot
heregot here

Actual result:
--------------
 The page cannot be displayed 
There is a problem with the page you are trying to reach and it cannot
be displayed. 

--------------------------------------------------------------------------------

Please try the following:

Open the x.x.x.x home page, and then look for links to the information
you want. 
Click the  Refresh button, or try again later.

Click  Search to look for information on the Internet. 
You can also see a list of related sites. 




HTTP 500 - Internal server error 
Internet Explorer  



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48233&edit=1

Reply via email to