SQL File System (Use SQL with ease)
2 Attachment(s)
Before using this system, I would highly recommend you use Chris Vimes SQL Explorer, to create your tables.
How it works? SQL File System runs your SQL Queries from the file directory sql/*. Novo originally wrote this system when I started to get into heavy development since I had such a learning curve with SQL. And in all honesty working with SQL has never been easier. -NPC Server Needs these rights PHP Code:
~Functions~ /** * This method updates the database * * @param query_name the named query * @param args the array of query arguments * @param debug echos in RC what SQL is doing * @param db what SQL Database you want to use /uses main.db if null */ update(temp.query_name, temp.args, temp.debug, temp.db) /** * This method returns a result set from the database * * @param query_name the named query * @param args the array of query arguments * @param debug echos in RC what SQL is doing * @param db what SQL Database you want to use /uses main.db if null * @return the results (TSQLRequest) */ read(temp.query_name, temp.args, temp.debug, temp.db) /** * This method returns the first column values as an array * * @param query_name the named query * @param args the array of query arguments * @param debug echos in RC what SQL is doing * @param db what SQL Database you want to use /uses main.db if null * @return the first column results */ readFirst(temp.query_name, temp.args, temp.debug, temp.db) -Examples on how to use the System. We are going to create a table called test using SQL Explorer with the rows test1, test2, test3 with test1 being unique. PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
you have a wasteful 'getcallstack()' call in read() and your sanitize SQL function references a non-existent function.
escapestring2(text); is the built-in function for sanitizing values for SQLite queries. PHP Code:
PHP Code:
|
very resourceful didn't think of that regarding the levels sub-directory.
That getCallStack was a test thing that i forgot to remove, I apologies for that. Will update it using levels and escapstring2. But you could use decimals and integars inside the textfile with something like this. PHP Code:
PHP Code:
|
All times are GMT +2. The time now is 05:03 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.