Thursday, 22 March 2012

How to Create a MySQL Database if it Doesn't Exist - Very Easily

This is so easy I almost don't believe it, except I've tested it and it works.

$create = mysql_query("CREATE DATABASE IF NOT EXISTS databasename");

Crazy easy, no?

No comments:

Post a Comment

Please enter your message here...