Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $DB_CON;
- function DBConnect($print)
- {
- /* INSERT MYSQL SETTINGS HERE */
- $host="127.0.0.1";
- $username="root";
- $password="";
- $database="artur";
- /* Make a connection to MySQL and select database */
- $GLOBALS['DB_CON']=mysql_connect($host,$username,$password);
- if(!$GLOBALS['DB_CON'])
- die('Database ERROR: ' . mysql_error());
- mysql_select_db($database,$GLOBALS['DB_CON']);
- }
- function DBClose()
- {
- mysql_close($GLOBALS['DB_CON']);
- }
- function DBQuery($sql)
- {
- DBConnect();
- $result= mysql_query($sql);
- DBClose();
- return $result;
- }
- $result= DBQuery("SELECT * FROM moridim");
- ?>
Add Comment
Please, Sign In to add comment