Thread: Efficiency
View Single Post
 
Old May 13th, 2008, 09:24 AM
ciderpunx ciderpunx is offline
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You include the file with the connect function in it, but you never call the function.

Try:
Code:
include('testcon.inc.php'); // include file
$connection = connect(); // call function
if ($connection) {
  echo ("Connection created ...");
} else {
  echo ("Error connecting to database!");
}
--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk