Scripts and functions that I have written or found useful

Quick and simple Mysql connect

September 8th, 2006 Posted in MYSQL

This is the simplest and neatest way to connect to a MySQL database using php

PHP:
  1. $dbh=mysql_connect ("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());
  2. mysql_select_db ("database_name");

Post a Comment