Try this if you wouldn't mind after line 171, add the following:
Ie:between these two lines:Code:$epdlanguage_query->store_result();
Code:$epdlanguage_query = ep_4_query("SELECT languages_id, name FROM ".TABLE_LANGUAGES." WHERE code = '".DEFAULT_LANGUAGE."'"); if (($ep_uses_mysqli ? mysqli_num_rows($epdlanguage_query) : mysql_num_rows($epdlanguage_query))) {
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Done
Now get blank white page. Error log generated as follows
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 990
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_errno() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 991
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 895
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 990
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_errno() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 991
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 895
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 990
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_errno() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 991
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 895
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 990
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_errno() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 991
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 895
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 990
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_errno() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 991
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 895
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 990
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_errno() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 991
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 895
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 990
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_errno() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 991
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 895
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_character_set_name() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/easypopulate_4.php on line 138
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 990
[21-Aug-2014 12:06:11 America/Denver] PHP Warning: mysqli_errno() expects parameter 1 to be mysqli, resource given in /home3/beadins1/public_html/bI1544+/includes/functions/extra_functions/easypopulate_4_functions.php on line 991
[21-Aug-2014 12:06:11 America/Denver] PHP Fatal error: Call to a member function store_result() on a non-object in /home3/beadins1/public_html/bI1544+/easypopulate_4.php on line 172
Ami correct that the three lines read:
In that sequence?Code:$epdlanguage_query = ep_4_query("SELECT languages_id, name FROM ".TABLE_LANGUAGES." WHERE code = '".DEFAULT_LANGUAGE."'"); $epdlanguage_query->store_result(); if (($ep_uses_mysqli ? mysqli_num_rows($epdlanguage_query) : mysql_num_rows($epdlanguage_query))) {
Here's what I have found regarding the way this has gone. Prior to the use of mysqli_, it seems that although possible, not as frequent that the returned data would be unbuffered and therefore when a function such as num_rows was called, the value returned would either be 0 (unbuffered) or the number of rows that actually exist(ed). It appears that the two reported occurrences of this have been more of the result of the return of zero rows even though the data could be enumerated. I have two alternative tests I'm working on for you to try which may need to happen in the functions file or in the main base file. The above error list is similar to what I observed when updating EP4 to work under ZC 1.5.3. Though I want to be sure that the above code is in the correct sequence before continuing down that alternative path. Also, wanted to verify that the test(s) that were requested in the original notification of this problem were also run with equivalent results. (Ie, verification that performing the sql query in myphpadmin had a successful result.)
Some of the next "solution" is to identify in how many places the additional "correction" would be needed. I thought that the num_rows function was only used the one time and all other actions were based on straight forward pull and check type routines, not necessarily a "hey how many" type call.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Lines 171 to 180
$epdlanguage_query = ep_4_query("SELECT languages_id, name FROM ".TABLE_LANGUAGES." WHERE code = '".DEFAULT_LANGUAGE."'");
$epdlanguage_query->store_result();
if (($ep_uses_mysqli ? mysqli_num_rows($epdlanguage_query) : mysql_num_rows($epdlanguage_query))) {
$epdlanguage = ($ep_uses_mysqli ? mysqli_fetch_array($epdlanguage_query) : mysql_fetch_array($epdlanguage_query));
$epdlanguage_id = $epdlanguage['languages_id'];
$epdlanguage_name = $epdlanguage['name'];
} else {
//exit("EP4 FATAL ERROR: No default language set."); // this should never happen
exit("EP4 FATAL ERROR: No default language set. Table: ".TABLE_LANGUAGES." Code: ".DEFAULT_LANGUAGE." is set" ); // this should never happen
}
Two different thoughts for solution...
Okay, try removing the new line 172 from admin/easypopulate_4.php
And add in admin/includes/functions/extra_functions/easypopulate_4_functions.php at line x:
The other thing I can think of trying is to still remove 172 in the above file, then replace the if statement that follows with:the below and comment out the line that follows that.Code:$result = ($ep_uses_mysqli ? mysqli_query($db->link, $query, MYSQLI_STORE_RESULT) : mysql_query($query));
Code:if (($epdlanguage = ($ep_uses_mysqli ? mysqli_fetch_array($epdlanguage_query) : mysql_fetch_array($epdlanguage_query)))) { //$epdlanguage = ($ep_uses_mysqli ? mysqli_fetch_array($epdlanguage_query) : mysql_fetch_array($epdlanguage_query));
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
A third option if the first aabove is a no go is to place a line at 991 og the functions file, similar to what was added in line 172 in the main file with the appropriate variable substitution.
This would be something instead of 1 or 2. So suggesting to implement only one of these three at a time for now.
My reasoning behind all this is the following.
The query function is supposed to default to the store option suggested in the first option; however, it is possible that this version of php on the host could have something incorrectly configured/compiled and does not default to that constant. Next is that the constant could be incorrectly assigned and not accounted for in the query function. If so, the first option above won't resolve the issue. The second option above is suggested in the event that the query is coming back with a result, but the num_rows function isn't returning a value until either the result has been completely stepped through, or a result has been tested, so the second modification should identify if the query returned with something because if it did then the language should be assigned in the if statement. If the query comes back with more than one result, well we rent worried about that and justuse the first returned result. The third revision identified in this post is to further account for the reason(s) why the first option was unsuccessful and to force the action of storing the result, but doing so while the result is still in memory, where the previous attempt at line 172 may have been performed when the data was already lost.
Unfortunately, the environment(s) in which this has been tested have not produced the troubled results seen by the two of you.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
The next thing I can see to do is to look through the ZC code for the db class and see how queries under mysqli_ style calls are handled. It may be that some query preparation needs to be performed although it appears that none of the data into EP4 really is subject to malicious action. Hmm, maybe the query in line 171 where the single quotes are used need to be escaped for the query to work? Or the single quotes removed from around the returned variable(s). Although I had already suggested hard coding the query (not using variables) to see if that would be successful, not directly to you, but as an attempted solution.)
Not being able to reproduce the issue makes it difficult to suggest solutions. Between the time of it working and now when it doesn't, nothing was added to the cart code? No template changes? Anything that could cause something to load as a part of kicking off the code that could interfere or modify the expected response(s) of the system?
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
I tried the second solution - still the same problem.
Please know I am not a coder, nor do I play one on TVso I do not know what you mean by the "line x" in the following statement:
"And add in admin/includes/functions/extra_functions/easypopulate_4_functions.php at line x:"
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Bookmarks