Click to See Complete Forum and Search --> : undefined function (php)


arioch
06-20-2007, 04:16 PM
Hi guys.

I'm creating a loginform, with an included DBconnector file that reads in it's parameters from an .ini file. I get the following error:

Fatal error: Call to undefined function: parse_ini_string() in /home/arioch/public_html/dbconnector.php on line 2

I have "php4-mysql" installed so that ain't it.


<?php
$dbvalues = parse_ini_string('dbusers.ini') or die("Could not read config file");
$_SESSION();
If ($_SESSION['user'] == 1) {
$SQL = $dbconnector = @mysql_connect($dbvalues['hostname'],$dbvalues['databaseroot'],$dbvalues['databaserootpassword']) OR die('<h3 class="warning">Failure: Failed connecting to the database. Verify that the parameters you gave are correct, and that the database is running and accessible.</h3>');
}
else {
$SQL = $dbconnector = @mysql_connect($dbvalues['hostname'],$dbvalues['customer'],$dbvalues['customerpassword']) OR die('<h3 class="warning">Failure: Failed connecting to the database. Verify that the parameters you gave are correct, and that the database is running and accessible.</h3>');
}
$dbselector = @mysql_select_db($dbvalues['databasename']) OR die('<h3 class="warning">Failure: Failed selecting your database. Verify that the parameter you gave is correct, and that the database is running and accessible.</h3>');
?>

What am I missing?

canon006
06-20-2007, 11:36 PM
I think what you might be looking for is "parse_ini_file()"? "parse_ini_string" doesn't seem to appear in any of the PHP documentation.

crow2icedearth
06-24-2007, 12:10 AM
parse_ini_string('dbusers.ini')

is that a function i would check php.net to find out... i have never see that before. what is your script trying to do?? you run mysql i can see that.... to connect to mysql use php function

mysql_connect read the php manual about it