SQL Error
5 posts by 3 authors in: Forums > CMS Builder
Last Post: March 27, 2009 (RSS)
By everbatim - March 25, 2009 - edited: March 25, 2009
- MYSQL ERROR:
Table 'C163167_ewcms.amember_error_log' doesn't exist
in query:
INSERT INTO amember_error_log (member_id, time, remote_addr, url, referrer, error) VALUES (NULL, NOW(), '98.117.203.91', '/login/member.php', 'http://eclipsewebinars.com/login/member.php', 'MYSQL ERROR:
Table \'C163167_ewcms.amember_error_log\' doesn\'t exist
in query:
INSERT INTO amember_error_log\r\n (member_id, time, remote_addr, url, referrer, error)\r\n VALUES\r\n (NULL, NOW(), \'98.117.203.91\',\r\n \'/login/member.php\', \'http://eclipsewebinars.com/login/member.php\',\r\n \'WARNING: urlencode() expects parameter 1 to be string, array given\\nin line 409 of file /hsphere/local/home/c163167/eclipsewebinars.com/cms/lib/viewer_functions.php\')\r\n ')
I also receive this error ABOVE my page layout in text format:
WARNING: urlencode() expects parameter 1 to be string, array given in line 409 of file viewer_functions.php
Notice: Undefined property: db_mysql::$debug_sql in /hsphere/local/home/c163167/eclipsewebinars.com/login/plugins/db/mysql/mysql.inc.php on line 3089 Strict Standards: Only variables should be assigned by reference in /hsphere/local/home/c163167/eclipsewebinars.com/login/common.inc.php on line 284 Warning: urlencode() expects parameter 1 to be string, array given in /hsphere/local/home/c163167/eclipsewebinars.com/cms/lib/viewer_functions.php on line 409 Warning: urlencode() expects parameter 1 to be string, array given in /hsphere/local/home/c163167/eclipsewebinars.com/cms/lib/viewer_functions.php on line 410 Warning: urlencode() expects parameter 1 to be string, array given in /hsphere/local/home/c163167/eclipsewebinars.com/cms/lib/viewer_functions.php on line 409 Warning: urlencode() expects parameter 1 to be string, array given in /hsphere/local/home/c163167/eclipsewebinars.com/cms/lib/viewer_functions.php on line 410 Warning: urlencode() expects parameter 1 to be string, array given in /hsphere/local/home/c163167/eclipsewebinars.com/cms/lib/viewer_functions.php on line 409 Warning: urlencode() expects parameter 1 to be string, array given in /hsphere/local/home/c163167/eclipsewebinars.com/cms/lib/viewer_functions.php on line 410 Warning: urlencode() expects parameter 1 to be string, array given in /hsphere/local/home/c163167/eclipsewebinars.com/cms/lib/viewer_functions.php on line 409 Warning: urlencode() expects parameter 1 to be string, array given in /hsphere/local/home/c163167/eclipsewebinars.com/cms/lib/viewer_functions.php on line 410
Most of the lines in the error above are from aMember UNTIL you get to the "WARNING" message in the second to last line. Again, if I remove the CMS Builder scripts from the page, the error goes away and the site works fine (minus my content of course!).
Thanks again!
Re: [everbatim] SQL Error
By ross - March 26, 2009
Thanks for posting!
Based on the error message, I am thinking it's coming from a detail page. What's happening is CMS Builder grabs a number out of the URL when you are on a detail page and brings up the appropriate article based on that. By default, the number is always the last thing in the URL.
In this case though, it looks like your other scripts also put things in the URL and now the scripts have confused each other.
If I am on the right track here so far, I think the solution is going to be hardcoding the link on your list pages that go to the detail page.
By default, you are probably using $record['_link'] as the href part of your link tag. What you'll want to do is something like this:
<a href="detailPageName.php?aMemberVariables&otherScriptVariables&<?php echo $record['num']; ?>
What I've done there is made sure the CMS Builder record number is the last thing in the URL.
Does that make sense? Does it sound like this might get things going? Give it a shot and let me know :).
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com
Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/
Re: [ross] SQL Error
By everbatim - March 26, 2009
Thanks for the assistance. Your right on in the fact that this is a "details" page. I keep my site very simple and as a result ALL of the content pages on my site are simple detail pages. What I ended up doing was making a duplicate of the "viewer_functions.php" file gave it a unique name. On all the pages that ONLY rely on CMS Builder to pull it's content, I reference the original file. On all the pages that interact with an additional PHP application to pull both content and database functions I reference the duplicate file. The only difference between the two files is that in the duplicate I removed the offending code, which were lines 409 and 410 in viewer_functions.php which were calling the URLENCODE issues you were speaking of. My basis on doing this was that since my site does not need to encode the URL's through CMS Bulder when it's combined with my third part PHP apps, there would be no need to even allow it to do so on those pages.
So far everything is working OK. All the pages (both the ones using the original file and the duplicate file) are stable and are not throwing errors. I'm still in the development stages of the site, so I may infact find something that this doesn't "jive" with my adjustement.
Can you think of any downsides to what I have done?
Re: [everbatim] SQL Error
By Dave - March 27, 2009
I think that should be fine. But I'll update the code for the next version it development so it doesn't produce that error.
I think it's happening when there are multiple form fields with the same name, like this: ?color[]=red&color[]=blue
It's not meant to handle that. If you want to just add some code to skip those values (which CMS Builder shouldn't need) just search for urlencode and add the line in red:
if (is_array($value)) { continue; }
$extraQueryArgs .= urlencode($key) .'='. urlencode($value) . '&';
$extraPathInfoArgs .= urlencode($key) .'-'. urlencode($value) . '/';
Hope that helps!
interactivetools.com
Re: [Dave] SQL Error
By everbatim - March 27, 2009
Thanks again! :-)