Archive for the 'sql' Category
« Previous EntriesNext Entries »
Saturday, August 23rd, 2008
Carrying on from my last post about connecting to an SQL database using PHP, here are the functions I use to open and close database connections (Note: » just extends the line, you’ll need to remove that for this to work correctly).
// to open the database
function connectToDatabase () {
$link = mysql_connect("localhost", "database_name", »
"database_password");
if ($link && mysql_select_db("database_name"));
return ($link);
return (FALSE);
}
// to close the database
function db_close($connecter) {
mysql_close($connecter);
}
It’s a good idea to keep these database connection functions in one place and then reuse them as you need, rather than repeating them everywhere.
Read the rest of this entry »
Posted in php, snippets, sql | 1 Comment »
« Previous EntriesNext Entries »
Stand Up Guy
An icon for overweight middle aged bogun-geek web designers. A lego block in a Meccano world. A synergy of tattoos, memories of bare knuckle fist fights, and old episodes of Star Trek. My name is Steven Clark and I'm a highly opinionated web designer with a few good ideas. I'm too old for fist fights.
My photography blog Walk a Mile in my Shoes is back up and running. Due to bandwidth issues it's only one image at a time and not full text in the RSS feed. It's licensed under creative commons , meaning not for commercial use and you need to attribute, otherwise drop me a line via the contact form on this site.
You might also like to check out my links blog over at Nortypig.com to learn more about everything worth mentioning.
Currently I only have a static page for illustrations but if time allows I'd like to start another illustration blog.
Site Content
Developed and published by Steven Clark
Site Supporters
Hosted by Brett at Tashosting