june_c21 Posted May 6, 2008 Share Posted May 6, 2008 hi, i not sure what's wrong with this function. can someone help me. thanks function db_connect($name,$host,$login,$password) { $conn_string = "dbname=".pg."; ($host?" host=".localhost""). ($login?" user=".root""). ($password?" password="""); $conn = new pg_connection($conn_string); if ($conn->handle) register_shutdown_function(array($conn,"close")); else $conn=false; return $conn; } Quote Link to comment https://forums.phpfreaks.com/topic/104305-solved-error-with-function/ Share on other sites More sharing options...
947740 Posted May 6, 2008 Share Posted May 6, 2008 Is there a specific error message? Or is it just not working? Quote Link to comment https://forums.phpfreaks.com/topic/104305-solved-error-with-function/#findComment-534062 Share on other sites More sharing options...
june_c21 Posted May 6, 2008 Author Share Posted May 6, 2008 Call to undefined function pg_connect() in c:\wamp\www\vphotoalb-1.96\html\include\db_pg.php on line 90 Quote Link to comment https://forums.phpfreaks.com/topic/104305-solved-error-with-function/#findComment-534073 Share on other sites More sharing options...
DarkWater Posted May 6, 2008 Share Posted May 6, 2008 Are you trying to connect to a MySQL database or PostgreSQL? You need the PostgreSQL module if you want to use pg_connect. Quote Link to comment https://forums.phpfreaks.com/topic/104305-solved-error-with-function/#findComment-534076 Share on other sites More sharing options...
june_c21 Posted May 6, 2008 Author Share Posted May 6, 2008 oh ic. thanks Quote Link to comment https://forums.phpfreaks.com/topic/104305-solved-error-with-function/#findComment-534084 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.