This topic is locked
[SOLVED]

 problem getting started

10/23/2008 6:21:29 AM
PHPRunner General questions
P
pauloc author

Hi
I am sure there is some little thing not quite right in my setup.

This is my first program
Win XP pro

IIS is installed and running

MySQL 5 installed

MySQL Front 3 installed

One Database with one empty table created

PHP 5 installed

PHP Runner 5 installed
No problems locating the database and table then building my application in PHP runner.

when choosing to view in browser I recieve this message
Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\include\dbconnection.php on line 9
Here is the first bit of dbconnection.php
<?php
function db_connect()

{

global $host,$user,$pwd,$errstr,$sys_dbname,$port,$bSubqueriesSupported;

$strhost=$host;

if($port && $port!=3306)

$strhost=$strhost.":".$port;

$conn = mysql_connect($strhost,$user,$pwd);

if (!$conn || !mysql_select_db($sys_dbname,$conn))

{

trigger_error(mysql_error(), E_USER_ERROR);

}

$mysqlversion = "4";

$res = @mysql_query("SHOW VARIABLES LIKE 'version'",$conn);

if($row=@mysql_fetch_array($res,MYSQL_ASSOC))

$mysqlversion = $row["Value"];

if(substr($mysqlversion,0,1)<="4")

$bSubqueriesSupported=false;

return $conn;
I am asuming at line 9 includes $conn = mysql_connect($strhost,$user,$pwd);

and is looking for $strhost, $user and $pwd.

does $strhost refer to the database name?

MySQL is configured with the default usernae root with a null password

this is what PHPRunner uses to access the database while creating the applicaton.

Where are these values stored?
I am sure there is some little thing missing.
Thanks

Paul

T
thesofa 10/23/2008

have you looked at the connection between php and iis, if I recall it is not easy to get php and IIS running,
put this in a file called test.php in the root of the IIS www space

<?php

phpinfo();

?>



then go to localhost/test.php

if you get the standard info page about php with acres of detail about php variable, all is fine, if not then google for IIS PHP and XP
HTH

P
pauloc author 10/23/2008

have you looked at the connection between php and iis, if I recall it is not easy to get php and IIS running,

put this in a file called test.php in the root of the IIS www space

<?php

phpinfo();

?>



then go to localhost/test.php

if you get the standard info page about php with acres of detail about php variable, all is fine, if not then google for IIS PHP and XP
HTH


Thanks for the info.

Yes I do get a very long page of PHP info

It proves the PHP does work.
What next?

T
thesofa 10/23/2008

Put some dummy data in the table, if it is full of null values, it might trip this error.

P
pauloc author 10/24/2008

Put some dummy data in the table, if it is full of null values, it might trip this error.


I have populated the table.

The same error remains.

J
Jane 10/24/2008

Pauloc,
PHP needs to be set up to use it with MySQL.

To do that please open php.ini file in your C:\Windows directory with a text editor, find the string
;extension=php_mysql.dll
and remove a semicolon from the beginning.

Then find the string beginning with
extension_dir =
and make sure that this points to folder within your PHP installation where php_mysql.dll file resides. Usually it is "c:\php\extensions"

And at last copy libmysql.dll from your MySQL installation into the C:\Windows\System32 directory.

P
pauloc author 10/24/2008

Pauloc,

PHP needs to be set up to use it with MySQL.

To do that please open php.ini file in your C:\Windows directory with a text editor, find the string
;extension=php_mysql.dll
and remove a semicolon from the beginning.

Then find the string beginning with
extension_dir =
and make sure that this points to folder within your PHP installation where php_mysql.dll file resides. Usually it is "c:\php\extensions"

And at last copy libmysql.dll from your MySQL installation into the C:\Windows\System32 directory.


Jane

Thank you very much.

I knew it was something simple.
Thank you