View Single Post
  #15 (permalink)  
Old 11-02-2008, 08:27 PM
LeadMagnet's Avatar
LeadMagnet LeadMagnet is offline
Mr. Tambourine Man
 
Join Date: Jun 2007
Location: Ireland
Gender: Male
Posts: 1,381
Default

The first one is the more usual way of doing it, but the second will work if connect_db() is called. Since $conn isn't global, you need to type something like

PHP Code:
$foo connect_db(); 
not 100% on that.
$foo will be your link after that. It's not a bad way of doing it if you plan on re-using the code lots.
__________________
Subtlety is my middle name... and first and last in case you didn't get the point.
Reply With Quote