SQLlogin.php 948 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
/*
to import, use "source ..." use full path, dont use ";", use ".sql" @ the end

to describe a table in mysql:
	mysql> desc employee;

to describe in green geeks:

table> select a table> structure


this page connects to the SQL server. It includes 
the username and password, which are private.
Hence, it won't be put on the public web server.

http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers
*/
michael lundquist's avatar
michael lundquist committed
19
include_once(dirname(__FILE__)."/configNuts.php");
20
21

function SQLlogin(){
22
	$server = "127.0.0.1";
23
24
25
	$username = "root";
	$password = "root";

26
	if(strpos(PHP_ROOT,"public_html") !== FALSE){
27
		//greengeeks credentials
28
		echo "here";
29

michael lundquist's avatar
michael lundquist committed
30
		$server = "mikeroservices.com";
31
32
33
34
		$username = "sellmysh";
		$password = "j8C4Rrh5f9";
		
	}
35

36
	$con = new mysqli($server,$username,$password);
michael lundquist's avatar
michael lundquist committed
37
	$con->select_db("sellmysh_zip");//TRUE on success, FALSE on fail
38
39
40
41
42
43
44
45
46
47
48
49
	return $con;
}

/*
closes the connection
*/
function SQLclose($conn){
	$conn->close();
}


?>