PHP chat SQLSTATE[HY000]: General error: 2053
I am currently trying to install this Facebook style PHP chat/shoutbox with jquery onto my website shared here: http://www.adam-bray.com/blog/109/facebook-style-php-chat-shoutbox-jquery/
if the site doesnt work here is a cache version: http://webcache.googleusercontent.com/search?q=cache:pYWQsmamNRQJ:www.adam-bray.com/blog/109/facebook-style-php-chat-shoutbox-jquery/+&cd=1&hl=fi&ct=clnk&gl=fi
so i keep getting the same error: SQLSTATE[HY000]: General error: 2053 every time when i post a message. I am not a good coder and i would like to find the part that makes this error and fix it.
error_log shows this:
[27-Jan-2017 07:12:38 America/New_York] PHP Notice: Undefined index: anti_spam in /home/myuser/public_html/privatestream/includes/session.php on line 23
in session.php on line 23: return $_SESSION[$name];
but i doubt it has something to do with it? I googled and might be something to do with PDO / database?
Comments
First point: this code is horrible. Please don't use it.
If you really want to continue, General error 2053 is returned when you execute a PDO query that fetches data, there is no data to fetch, and there is no proper error handling.
The error regarding anti_spam is because the index does indeed not exist at the point that it gets called because, again, this code is crappy. It may have worked at some point on some older PHP version, or at least didn't alert.
This appears to be from 2014: https://github.com/adambray89/php-facebook-chat. You can find newer versions, and should do so. The statement of "Before we get started, please ensure you're running at least PHP 5.3." could be rewritten as "please ensure you're running at least a 3 year old unsupported version of PHP".
Hey, thanks for your answer @Damian. Im still new to stuff like this, so this was good to know. Do you have recommendations on real-time chat that i can embed and other free script providers?
See https://www.lowendtalk.com/discussion/102333/live-chat-software
I think he wants more of a chat room (rather than live chat software).
Oops!
IRC
You should eyeball Blab 8.2 for chat. No sql needed, simple to install and its free.
https://justblab.com/
Thanks for your answers all i will look into them. Feel free to post even more links if you have had good experience with something.
mysql is needed for this chatroom, my mistake.
I don't mind mysql as long as the chat is real-time as in others don't have to refresh anything. Embedded IRC could be nice too.