ladogton2010 commited on
Commit
32d3b2e
·
1 Parent(s): b300066
Files changed (2) hide show
  1. Dockerfile +4 -0
  2. app/index.php +26 -0
Dockerfile ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ FROM php:12.6-cli
2
+ COPY app app
3
+ WORKDIR /app
4
+ CMD ["bash","-c","php -S 0.0.0.0:7860"]
app/index.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ # Fill our vars and run on cli
3
+ # $ php -f db-connect-test.php
4
+
5
+ $dbname = 'bkncpjiyngowz76xww2o';
6
+ $dbuser = 'ug1zj7b590kywzjv';
7
+ $dbpass = '7ENs2AP4uwqlo1YhXXgB';
8
+ $dbhost = 'bkncpjiyngowz76xww2o-mysql.services.clever-cloud.com';
9
+
10
+ $connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
11
+ mysql_select_db($dbname) or die("Could not open the db '$dbname'");
12
+
13
+ $test_query = "SHOW TABLES FROM $dbname";
14
+ $result = mysql_query($test_query);
15
+
16
+ $tblCnt = 0;
17
+ while($tbl = mysql_fetch_array($result)) {
18
+ $tblCnt++;
19
+ #echo $tbl[0]."<br />\n";
20
+ }
21
+
22
+ if (!$tblCnt) {
23
+ echo "There are no tables<br />\n";
24
+ } else {
25
+ echo "There are $tblCnt tables<br />\n";
26
+ }