By: Michaelsen
Date: 2011-05-27
Time: 19:00
|
ezsql inside tbs functionsHello there,
I noticed since upgrading to tbs version 3+ for some time now, the ezsql codes inside tbs functions did not work anymore for me. Where before I had something like:
When using the ezsql syntax nothing returns on tbs functions. The same happens for $db->get_row and $db->get_results However I don't remember anybody complaining about this here in the forum, it is so strange it would be only with me, since I upgraded tbs and ezsql from scratch more than once in recent months. |
|||||
By: Skrol29
Date: 2011-05-27
Time: 22:49
|
Re: ezsql inside tbs functionsHi,
This is strange because ezSQL has nothing to do with TBS. By the way there is something strange with your function. In the first version it has syntax of an "ondata" function (parameter $CurrRec) while it seems the be an "onformat" function because $CurrRec is used like it is a value instead of record. And its new value is a value (given by $db->get_var(...)) In the second version the new value becomes a record (given by mysql_num_rows()). Both "ondata" and "onformat" functions should not return any value, they should only modify the arguments given by reference. |
|||||
By: Michaelsen
Date: 2011-05-28
Time: 00:22
|
Re: ezsql inside tbs functionsHello again,
I switched for the correct mode, this is working fine:
Now, if I do the following:
The strangest thing happens, it returns only one row in html side, [cats.cat_id;block=div] will display only the first item of what should be many, the function will return the correct value for the solitary div, if I change back to traditional php query, it will display all items on html side. |
|||||
By: TomH
Date: 2011-06-06
Time: 15:59
|
Re: ezsql inside tbs functionsNot sure I'm getting your problem, but the ezsql db->get_var function will only return one row in any case
Try $CurrVal = $db->get_results("..."); to see what happens |
|||||
By: Michaelsen
Date: 2011-06-06
Time: 21:30
|
Re: ezsql inside tbs functionsHello TomH,
This is what is happening, I did a tbs example from scratch, so I also can be sure nonthing I implemented was causing the problem.
If I change the catCount function as below:
Then the output shows like the following:
If I use $db->get_row or $db->get_results it happens the same thing. I guess TBS 3.7 has ezsql as native, but it asks me for the tbsdb_ezsql_open, tbsdb_ezsql_fetch and tbsdb_ezsql_close if I dont have it in the code. |
|||||
By: TomH
Date: 2011-06-09
Time: 15:34
|
Re: ezsql inside tbs functionsI can only suggest something to evaluate the problem... do plain queries (outside of your program logic) to see what are the actual returned query results -- you may not be getting the results you are expecting.
TBS does NOT have ezSQL native. Something is not correct if you are getting messages asking for ezSQL functions - maybe the versions (ezSQL and Skrol29's adapter for ezSQL) Oops!!! I see that you have not included Skrol's plugin for using ezSQL (see tbsdb_ezsql.zip under TBS Database Plugins page) - that maybe part of the problem! I have used TBS with ezsql for many years - until Skrol 29 made the recent major revisions to TbsSQL. Now I have converted completely over to TbsSQL because I have all of the ease of ezSQL features plus more -and- it is maintained by SKrol29 (Justin has essentially dropped development of ezSQL for some time now). Skrol29 has made it very easy to migrate from ezSQL to TbsSQL. Now the biggest reason for using TbsSQL is the debugging console - I can see every query, the actual results returned, whether it is from cache or not,and any MySQL error statements -- and all in a separate popup window that keeps the debugging stuff completely away from the php/html page output. TomH |
|||||
By: Michaelsen
Date: 2011-06-09
Time: 20:14
|
Re: ezsql inside tbs functionsOk, I really appreciate your reply and I'm looking forward to TbsSQL, unfortunately up to this date I tought TbsSQL wasn't an ezsql replacement, but mainly kinda of a TBS connector, looking at http://www.tinybutstrong.com/tbssql.php I can see how wrong I was.
Also it is very comfortable to know we have a modern ezsql maintained by someone like Mr. Skrol29.
- Michaelsen |