Comment RSS Site RSS

Users

  • Register

  • Log in

    Quick Tip - How to connect to MySQL with PHP

    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 …



    Posted April 14, 2008 By Bryan
    Filed under: Articles, Programing, Quick Tips, Tutorials, Web, Web Dev Tutorials, news

    Leave a Reply