Hi,
I'm currently working on a simple and easy text-based database class. I've got allmost all the functions and now I'm ready for improvements. One thing that's on the top of my list, is to make the script compatible with typical sql queries.
To do this I need a function that converts an sql query, determines what function to use (select(), insert(), update(), etc.) and supplies the correct paramaters.
My actual question is how I can break up an sql-query in bits, that I can feed to my various functions? An example: Currently I use the folowing to select the name and age of members that are older than 18: '$object->Select('members', 'name, age', 'age < 18')'. What I actualy would like to do is use the folowing query:
'SELECT name, age FROM members WHERE age < 18'.
Can anyone think of an idea how to handle such a thing? I'm not asking you for a complete script, but instead I'd like you to ask to supply a beginning and/ or some usefull tips.
Thanx in advance, Michiel
PS If more information is needed, please let me know and I would be happy to supply it to you!
I'm currently working on a simple and easy text-based database class. I've got allmost all the functions and now I'm ready for improvements. One thing that's on the top of my list, is to make the script compatible with typical sql queries.
To do this I need a function that converts an sql query, determines what function to use (select(), insert(), update(), etc.) and supplies the correct paramaters.
My actual question is how I can break up an sql-query in bits, that I can feed to my various functions? An example: Currently I use the folowing to select the name and age of members that are older than 18: '$object->Select('members', 'name, age', 'age < 18')'. What I actualy would like to do is use the folowing query:
'SELECT name, age FROM members WHERE age < 18'.
Can anyone think of an idea how to handle such a thing? I'm not asking you for a complete script, but instead I'd like you to ask to supply a beginning and/ or some usefull tips.
Thanx in advance, Michiel
PS If more information is needed, please let me know and I would be happy to supply it to you!
Comment