-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnect.sample.php
More file actions
37 lines (27 loc) · 1.14 KB
/
connect.sample.php
File metadata and controls
37 lines (27 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/*iDarwinCore version 1.1
By Robert R. Pace <robert.pace@eku.edu>
This database software is designed for natural
history collections utilizing Darwin Core Archive
data for online querying of the collection's data
This file (connect.php) contains the credentials necessary
for the PHP package to connect to MySQL server. Such items
as username, password, database name are stored in global
variables available to all PHP which contain an
include (connect.php) line.
*/
//mysql server ip:port
$dbhost = 'localhost';
//mysql server username
$dbuser = 'username';
//mysql server password
$dbpass = 'password';
//mysql database name
$dbname = 'idarwincore';
//connection variables which will establish connection to MySQL database or return error
$conn = mysqli_connect($dbhost, $dbuser, $dbpass) or die('Could not connect to mysqli: ' . mysqli_connect_errno());
//mysqli connection string
$mysqli = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname) or die('Could not connect to mysqli: ' . mysqli_connect_errno());
//select the database we want to be using for IDarwinCore (normally idarwincore)
mysqli_select_db($conn, $dbname);
?>