mirror of
				https://gitlab.com/ceda_ei/Datology-Bot
				synced 2025-10-30 16:10:06 +01:00 
			
		
		
		
	Sample config, setup and .gitignore.
Added .gitignore to avoid credentials, added sample credentials. Added setup to create table.
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | |||||||
|  | mysql_credentials.php | ||||||
							
								
								
									
										8
									
								
								mysql_credentials.php.sample
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								mysql_credentials.php.sample
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | <?php | ||||||
|  | return array( | ||||||
|  |   "servername" => "localhost", | ||||||
|  |   "username" => "username_goes_here", | ||||||
|  |   "password" => "password_goes_here", | ||||||
|  |   "database" => "database_name_goes_here" | ||||||
|  | ); | ||||||
|  | ?> | ||||||
							
								
								
									
										46
									
								
								setup.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								setup.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,46 @@ | |||||||
|  | <?php | ||||||
|  | // MySQL credentials | ||||||
|  | $mysql = require('mysql_credentials.php'); | ||||||
|  |  | ||||||
|  | $conn = new mysqli($mysql["servername"], $mysql["username"], $mysql["password"], $mysql["database"]); | ||||||
|  | if ($conn->connect_error) { | ||||||
|  |   die("Connection failed: " . $conn->connect_error); | ||||||
|  | }  | ||||||
|  |  | ||||||
|  | $query = "create table data( | ||||||
|  |   id int(10) primary key, | ||||||
|  |   a int(8) default 0, | ||||||
|  |   b int(8) default 0, | ||||||
|  |   c int(8) default 0, | ||||||
|  |   d int(8) default 0, | ||||||
|  |   e int(8) default 0, | ||||||
|  |   f int(8) default 0, | ||||||
|  |   g int(8) default 0, | ||||||
|  |   h int(8) default 0, | ||||||
|  |   i int(8) default 0, | ||||||
|  |   j int(8) default 0, | ||||||
|  |   k int(8) default 0, | ||||||
|  |   l int(8) default 0, | ||||||
|  |   m int(8) default 0, | ||||||
|  |   n int(8) default 0, | ||||||
|  |   o int(8) default 0, | ||||||
|  |   p int(8) default 0, | ||||||
|  |   q int(8) default 0, | ||||||
|  |   r int(8) default 0, | ||||||
|  |   s int(8) default 0, | ||||||
|  |   t int(8) default 0, | ||||||
|  |   u int(8) default 0, | ||||||
|  |   v int(8) default 0, | ||||||
|  |   w int(8) default 0, | ||||||
|  |   x int(8) default 0, | ||||||
|  |   y int(8) default 0, | ||||||
|  |   z int(8) default 0 | ||||||
|  | );"; | ||||||
|  | if ($conn->query($query) === true) { | ||||||
|  |   echo "Succesfully created table"; | ||||||
|  | } | ||||||
|  | else { | ||||||
|  |   echo "Error creating tables"; | ||||||
|  | } | ||||||
|  | $conn->close(); | ||||||
|  | ?> | ||||||
		Reference in New Issue
	
	Block a user