This class can be used to query arrays,html,xml or json file with a SQL-like syntax using LINQ.
It takes an array as parameter and can perform several types of queries using an SQL-like syntax as if the array was a relational database.
Currently it supports performing SELECT , DELETE, INSERT and UPDATE queries.
Example SELECT Queries:
========================
- SELECT *FROM myArray ORDER BY key DESC,value ASC,
- SELECT key,value FROM myArray WHERE value='100',
- SELECT * FROM json_file(my_json_file.txt),
- SELECT * FROM xml_file(http://tufyta.com/feed/).channel.item WHERE title LIKE '%linq%'
- SELECT *FROM html_file(http://tufyta.com).div WHERE class='post_title'
- SELECT *FROM text_file(data.txt) WHERE in_array('.line.',array(1,2,3,4,5,6,))
-SELECT * FROM dir_files(doc).files WHERE name LIKE '%D3Linq%'
- SELECT *FROM myArray.subitems WHERE name='Tufan'
- SELECT DISTINCT surname FROM personnels ORDER BY surname DESC
Example INSERT Queries:
========================
- INSERT INTO myArray (name,surname) VALUES ('Tufan','YILDIRIM')
- INSERT INTO myArray.subitems ('known_langs') VALUES ('PHP,C#,C++')
Example UPDATE Queries:
========================
- UPDATE myArray SET name='TUFAN' WHERE surname='YILDIRIM',
- UPDATE myarray.subitems SET known_lags='PHP,C#'
Example DELETE Queries:
========================
- DELETE FROM myArray WHERE name='Tufan'
- DELETE FROM myArray.subistems WHERE known_language LIKE '%PHP%'
This package can be used to import data stored in CSV files into a database.
The main class can import the data into a table named by imported CSV-file name. Table in database is like image of CSV file, query "DROP TABLE IF EXISTS `<CSV-filename>`" is called before table creation!
The types of the columns and other details can be defined in a separate configuration XML file. This package comes with one class that can parse and extract the configuration details.
The import class uses an external package to provide DBMS independent access to the database in order to store the imported data.
Access data in MySQL tables using object notations
This package can be used to store and retrieve data in MySQL databases using intuitive object notations.
There are several classes that abstract the access to a MySQL database table in order to create, read, update and delete database table rows as if they were objects.
This package can be used to show and process database access forms using AJAX.
There is one class that can generate HTML and Javascript to display form fields and have them validated immediately after the field values are changed.
Another class can validated and process the forms submitted via AJAX to update MySQL database records according to mappings also stored in the database.