getVar Function
Uses the virtual table name, field names, and user ID to retrieve (currently ALL of) the data from the dataLake pertaining to those filters.
array(2) {
[0]=>
array(4) {
["name"]=>
string(6) "Biripi"
["address1"]=>
string(3) "12a"
["address2"]=>
string(12) "22 Watson St"
["suburb"]=>
string(11) "Wagga Wagga"
}
[1]=>
array(4) {
["name"]=>
string(12) "Burrun Dalli"
["address1"]=>
string(16) "15 Sodbury Place"
["address2"]=>
NULL
["suburb"]=>
string(7) "Lismore"
}
}
getFieldNames Function
This function uses the virtual table id to retrieve the dataLake field names for the fields in the virtual table.Object Output.
array(4) {
[0]=>
string(4) "name"
[1]=>
string(8) "address1"
[2]=>
string(8) "address2"
[3]=>
string(6) "suburb"
}
Formatted in the calling code
name = T1
address1 = T2
address2 = T3
suburb = T4
This function is designed to return the database schema for a given database ID.
The virtual database DogHouse is A db for tracking dogs and their owners.. It does NOT actually exist, so there is no point in referring to the 'dog' table. It consists of the following tables and fields which map to the data stored in the 'dataLake' table:
Here is the mapping:
Virtual Table name: dog. A dog club database of dogs and their owners.
Virtual Field name: 'dog.dogName'.
Type of field: 'varchar'.
dataLake field where this is actually stored: 'dataLake.T1'.
Virtual Field name: 'dog.breed'.
Type of field: 'varchar'.
dataLake field where this is actually stored: 'dataLake.T2'.
Virtual Field name: 'dog.skill'.
Type of field: 'text'.
dataLake field where this is actually stored: 'dataLake.T3'.
Virtual Field name: 'dog.suburb'.
Type of field: 'varchar'.
dataLake field where this is actually stored: 'dataLake.V1'.
Virtual Field name: 'dog.owner'.
Type of field: 'text'.
dataLake field where this is actually stored: 'dataLake.T4'.
This function creates a prompt, feeds it to the AI and returns an SQL query to be processed.
Warning: Undefined variable $tableName in /home/quantu41/code.john-byrne.info/morph/functions.php on line 134
Warning: Undefined array key "choices" in /home/quantu41/code.john-byrne.info/morph/functions.php on line 137
Warning: Trying to access array offset on value of type null in /home/quantu41/code.john-byrne.info/morph/functions.php on line 137
Warning: Trying to access array offset on value of type null in /home/quantu41/code.john-byrne.info/morph/functions.php on line 137
Warning: Trying to access array offset on value of type null in /home/quantu41/code.john-byrne.info/morph/functions.php on line 137
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/quantu41/code.john-byrne.info/morph/functions.php on line 138
CREATE VIEW dbView AS SELECT * FROM dataLake WHERE tableId = '1'; ; DROP VIEW dbView;
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '; DROP VIEW dbView' at line 1 in /home/quantu41/code.john-byrne.info/morph/index.php:83
Stack trace:
#0 /home/quantu41/code.john-byrne.info/morph/index.php(83): mysqli_query(Object(mysqli), 'CREATE VIEW dbV...')
#1 {main}
thrown in /home/quantu41/code.john-byrne.info/morph/index.php on line 83