![]() |
![]() |
This project is not completely dead. I've just started work on localisation. If you're getting a "Deprecated" error message, follow the instructions here URGENT Security Patch for ≤ v2.2.6 A security hole has been discovered, follow the instructions and download the patch at the topic page. Did the patch break your search page? Search Patch
|
![]() UPB Team Member
Posts: 838
Registered: 2006-11-22 |
Hi,
I am developing a script at the moment that uses mySQL but was wondering about creating a TextDB version. Having looked through your manual I found it looked relatively easy but couldn't find anything on something equivalent to the LEFT JOIN or LIMIT functions of mySQL. Do you have an equivalent in TextDB, it would be ultra-useful if you did cause then I only need to program my script once rather than go through coding a complicated file based system as an alternative for those without mySQL access. Hope you do Clark myUPB Developer |
![]() UPB Team Member
Posts: 893
Registered: 2006-11-14 |
Could you explain the functionality of "LEFT", "JOIN", and "LIMIT"? Then we can better answer your question. Sorry, Tim and I REALLY like TextDB over SQL
![]() --Jerroyd Moore
Bachelors of Science, Computer Science 2011 Jack Baskin School of Engineering University of California, Santa Cruz |
![]() UPB Moderator
Posts: 311
Registered: 2006-11-15 |
LIMIT: Return results within the database but LIMIT to x results, an example would be in the forum, LIMIT to 30 threads.
LEFT JOIN will merge a database, an example would be users database and whos online database, the left represents the first table. so in TDB's version it would need to be something like: $tdb->join($fp, "LEFT", "table1", "table2"); and array_merge them. but thats just my thoughts. IMLeeds www.imleeds.com Company search engine. Search with IMLeeds. |
![]() UPB Team Member
Posts: 838
Registered: 2006-11-22 |
I working on a photo gallery script.
The categories are in one table with the category details and a unique ID for each one. The gallery details are in a separate table with the relevant category ID for each one and I use LEFT JOIN to merge the category details with the gallery details when viewing a gallery if the category IDs in both tables match. It means that instead of having to update every single row of the gallery table if the category details change I only have to perform one query. It helps speed things up........database normalisation I believe it's called. And LIMIT functions like the php array_slice function.......it would just make it easier to do it all in one go although it would be possible just to use the array slice function on the result array. myUPB Developer |
![]() UPB Team Member
Posts: 1034
Registered: 2006-11-14 |
we have no JOIN functionality but we do have LIMIT functionality on all our return functions (listRec, query), if you open up the textdb class file you will see the function prototypes with there aruments. your looking for $start and $howmany, I think those are self explainitory.
Tim Hoeppner
UPB Programmer B. Sc. in Electrical Engineering |
![]() UPB Team Member
Posts: 893
Registered: 2006-11-14 |
Also, I don't know if you've discovered our wiki documentation, but it's at www.myupb.com/wiki/index.php/TextDB_Manual.
Again what Tim said, there isn't any JOIN functionality, however the LIMIT functionality is achieved through the $start and $howmany arguements in tdb::listRec(), and tdb::query() (See Documentation for the appropiate argument #. The $start argument specifies howmany records you wish to skip before starting to return. For tdb::listRec(), it would simply skip that many records, however, for tdb::query(), it will skip that many records that match the query string, making this functionality very useful for paging. As far the $howmany, it simply returns that many records after $start. Similarly to $start, tdb::listRec(), will simply return that many records after $start, whereas tdb::query() will return that many records after $start that match the query string. Anyways, I hope that wasn't too wordy and I hope that deepens your understanding of TextDB. --Jerroyd Moore
Bachelors of Science, Computer Science 2011 Jack Baskin School of Engineering University of California, Santa Cruz |
![]() UPB Team Member
Posts: 838
Registered: 2006-11-22 |
All LEFT JOIN does is take the information from two tables and merges them into one.
I suppose I could do a query on the gallery and use the catid from that result and do a second query on that. Might prove a bit tricky converting a couple of the functions but it should do. I'll let you know how I get on and will post here if I become totally unstuck. I did read the Wiki Manual before I posted but it was at the end of a long day....probably should only read manuals when it's still the same day you woke up on
Thanks for the info. As your the TextDB gurus, would you be willing to test it once it's complete??? myUPB Developer |
![]() UPB Team Member
Posts: 893
Registered: 2006-11-14 |
yeah sure, we can test it for you.
--Jerroyd Moore
Bachelors of Science, Computer Science 2011 Jack Baskin School of Engineering University of California, Santa Cruz |
![]() UPB Team Member
Posts: 1034
Registered: 2006-11-14 |
I will consider adding a JOIN type function, I know alot of people use this in there SQL queries and it would be nice to do everything a SQL database can.
Tim Hoeppner
UPB Programmer B. Sc. in Electrical Engineering |
![]() UPB Team Member
Posts: 838
Registered: 2006-11-22 |
Have just begun the conversion process.........
So far so good Surrounded with pieces of paper from the excel file with all the function definitions and examples ![]() myUPB Developer |
|
Last edited by: Clark on Jan 24, 2007 6:50:54 pm
| |