Hi All,
I have installed PHP5.2 on IIS5 with MySQL4.x.
I have modified php.ini so that the ext folder is correct, moved the mysqllib.dll file to the php folder and when I call phpinfo() in a php scrip I can see the MyQLI information listed: -
mysqli
MysqlI Support enabled
Client API library version 5.0.22
Client API header version 5.0.22
MYSQLI_SOCKET /tmp/mysql.sock
Directive Local Value Master Value
mysqli.default_host no value no value
mysqli.default_port 3306 3306
mysqli.default_pw no value no value
mysqli.default_socket no value no value
mysqli.default_user no value no value
mysqli.max_links Unlimited Unlimited
mysqli.reconnect Off Off
this all looks to me as if PHP rcognises the dll and a connection to my sql shouls now work.
The following scrip should in my opinion work: -
<html>
<head>
<title>Test Project</title>
</head>
<body leftmargin="8" topmargin="7" marginwidth="8" marginheight="7">
<?php
echo 'before Connect';
$cnx = mysql_connect('192.168.10.1', 'root', 'yamaha') or die ("Could not connect");
mysql_select_db('pilot', $cnx) or die (mysql_error());
$sql = 'SELECT * from PilotDetails';
$result = mysql_query($sql) or die (mysql_error());
echo 'before While';
while($row = mysql_fetch_object($result))
{
echo 'Name = '.$row->Name;
}
echo 'after while';
?>
</body>
</html>
But running it all I get is the HTML generated up until echo before connect - I get literaly nothing afterwards: -
so my output is : -
"<html>
<head>
<title>Test Project</title>
</head>
<body leftmargin="8" topmargin="7" marginwidth="8" marginheight="7">
before Connect"
I don;t understand what I am doing wrong - any suggestions would be gratefully recieved.
Cheers
Dave
I have installed PHP5.2 on IIS5 with MySQL4.x.
I have modified php.ini so that the ext folder is correct, moved the mysqllib.dll file to the php folder and when I call phpinfo() in a php scrip I can see the MyQLI information listed: -
mysqli
MysqlI Support enabled
Client API library version 5.0.22
Client API header version 5.0.22
MYSQLI_SOCKET /tmp/mysql.sock
Directive Local Value Master Value
mysqli.default_host no value no value
mysqli.default_port 3306 3306
mysqli.default_pw no value no value
mysqli.default_socket no value no value
mysqli.default_user no value no value
mysqli.max_links Unlimited Unlimited
mysqli.reconnect Off Off
this all looks to me as if PHP rcognises the dll and a connection to my sql shouls now work.
The following scrip should in my opinion work: -
<html>
<head>
<title>Test Project</title>
</head>
<body leftmargin="8" topmargin="7" marginwidth="8" marginheight="7">
<?php
echo 'before Connect';
$cnx = mysql_connect('192.168.10.1', 'root', 'yamaha') or die ("Could not connect");
mysql_select_db('pilot', $cnx) or die (mysql_error());
$sql = 'SELECT * from PilotDetails';
$result = mysql_query($sql) or die (mysql_error());
echo 'before While';
while($row = mysql_fetch_object($result))
{
echo 'Name = '.$row->Name;
}
echo 'after while';
?>
</body>
</html>
But running it all I get is the HTML generated up until echo before connect - I get literaly nothing afterwards: -
so my output is : -
"<html>
<head>
<title>Test Project</title>
</head>
<body leftmargin="8" topmargin="7" marginwidth="8" marginheight="7">
before Connect"
I don;t understand what I am doing wrong - any suggestions would be gratefully recieved.
Cheers
Dave