EZ Results

Small bug when querying with ORDER BY

I have found a curious bug that occurs when searching and using 'ORDER BY'. The following query displays correctly:

SELECT FName,LName FROM Customer WHERE FName LIKE '%tom%' OR LName LIKE '%tom%'

But if I try to order the results with:

SELECT FName,LName FROM Customer WHERE FName LIKE '%tom%' OR LName LIKE '%tom%' ORDER BY FName

ezresults will consistently report the correct number of matches, but list one fewer result than it should. The top-most result (first in the sort) is always missing. So for example, a result might be:

4 Results
Floyd Tomlinson

Manipulating date, help please

Hi All,

I've installed and got it working fine. The only thing I'd like to change is the way ez_results displays the date that in the DB. The date format is 2001-05-15. I'd like it to display this date in UK format as 15-05-2001. The date is current displayed using COL8. I've read through the register function section but it's not very clear to me as a kind of newbie at PHP etc. I know I need to make a function to explode this date so I can reassemble in the UK order but I dont't know where to put the function nor where to call it from. Can anyone offer some guidance on this? Thank you

Possible Bug ...

This line:

$this->num_results = $db->get_var(preg_replace("/SELECT.*FROM/Ui","SELECT count(*) FROM",$query));

... is the culprit. If you have a query with something like this ...

SELECT DISTINCT products.* FROM products,product_category_map WHERE products.product_id=product_category_map.products_id AND product_category_map.category_id=1

... it ends up dropping the products.* and you get count(*). This is devastating for the query because it causes the get_num_results() function to return all of the results from the category table (in my case 23) instead of just the matches (which should be just four).

Passing URL Values

This little gem:

$ezr->set_qs_val('action','viewCategory');

Very much needed, and I was very happy to find it. Just wanted to alert others and make it known that it is in there.

Thanks!
Sean

Weird error - apache.exe

I get this weird error.
"The instruction at "0x014f7707" referenced memory at "0x00000000". The memory could not be "read".

Basically, i just copied the sample code from the website.
My code is
"
include_once “ez_sql.php”;

// Include the EZ Results Class

include_once “ez_results.php”;

// Perform query and display results
$ezr->query_mysql(“SELECT email, login FROM users”);
$ezr->display();"

I've created a table called "users" and populated fields email & login. I am running this off of win 2k laptop with xampp.

Can you help?

TIA,

Thomas Kim

EZ Results more CSS friendly ...

It seems that in order to be cross-browser compatible (mainly IE and Firefox) I need to make heavy modifications to the EZ results default template to get adequate CSS support. My suggestion (and one which I use) would be to change the variables using alternating colors to classes instead of using the bgcolor attribute.

For example ...

var $alt_color1a = "ffffff"; // ALTCOLOR1 in results row

... would become ...

var $alt_color1a = "CSSClassName"; // ALTCOLOR1 in results row

Then in the $results_row ...

var $results_row = "<tr><td bgcolor=ALTCOLOR2>COL1</td><td>COL2</td><td>COL3</td></tr>";

Featured Items

I am trying to create a set of featured items at the top of the results pages (like HotScripts.com) where their background and border are a different color, and they are the first to come up in the results. Now, the ordering I can do in a SQL statement using a column in the table called 'ranking':

SELECT * FROM table WHERE row_id = 123 ORDER BY ranking DESC

What I need now, is a way to manipulate each row to show the correct designation. For example, if I get a ranking 7 through 10, I want the result row to change to a red border and a light pink background. Conversly, if the ranking is below 7 then the color would be a gray background with a black border.

pass by value / reference

So I installed the latest ez_results package, on OSX, with PHP 4.3.11. I am using the register_function feature, to format some date information for display:

$ezr->register_function('format_comment_time');

But I am getting this in the php error log:

[Thu Feb 9 06:04:06 2006] [error] PHP Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of format_comment_time(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /docroot/ez_results.php(329) : eval()'d code on line 1

Corrupted Ezresult Download

I tried downloading the ezresult zipped file but unable to extract it. Error message was unexpected end of file. Is there any other sites that I can download from?

Thanks.

Different Results When Using ez_results

I have no problems using ez_results with smarty. However, I seem to have this problem when using the following sql query.

SELECT DISTINCTROW lab_ID, lab_title FROM t01_label
INNER JOIN t01_stock ON t01_stock.sto_lab_ID = t01_label.lab_ID
WHERE t01_stock.sto_qty > 0 ORDER BY lab_title

When I run the above query from phpMyAdmin, I get 1221 results. However, using it on my page using ez_results.smarty.php, I get 2089 results with 141 pages of 20 results on each page.

Page 63 onwards will show empty page, though the navigation will show up to Page 141. What seems to be the problem?

Syndicate content