Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MYSQLI Installation

Status
Not open for further replies.

beridor

MIS
Aug 8, 2003
26
GB
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 don't understand.

In the beginning of your post, you talk about the mysql[red]i[/red]_* (improved MySQL) family of functions. But in the code you've posted, your're using the mysql_* (original MySQL) family of functions.




Want the best answers? Ask the best questions! TANSTAAFL!
 
Thanks for that, I see now what I was doing wrong - I assumed that MSQLI would be backwards compatible with MYSQL statements. I know have the basic code working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top