MYSQL - PHP simple connect function


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function connectDb() {
  2. // connect and set the
  3. // working db
  4. if (mysql_connect( DBHOST, DBUSER, DBPWD ) && mysql_select_db( DBNAME )) return true; else return false;
  5. }

URL: http://www.barattalo.it/2010/01/25/10-php-usefull-functions-for-mysql-stuff/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.