Quick Tip – How to connect to MySQL with PHP

Posted July 5th, 2010 by Bryan in Tutorials

This is a Quick Tip on how to connect to MySQL with PHP. We have all done it from time to time, but sometimes we forget just how to connect to those pesky MySQL databases directly using PHP. So here’s how it’s done:
<?php
function open( ){$db = mysql_connect( ‘localhost’, ‘root’, ‘password’ );
} ?>

Here we have custom a function “open”. Followed by the mysql_connect function which we will supply the url, username, and password. It’s pretty simple to do in PHP. Thanks for reading

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

  •  

    img_5756 me-demonstrating-how-to-put-out-the-two-man-pit img_5652 img_5654 img_5622 img_5609 d30_4158 operating-pressure-demonstration