idp85 Posted February 16, 2011 Share Posted February 16, 2011 Hello everyone! I haven't messed with mySQL or PHP in a few years, and things apparently have changed quite a bit! In going back and updating an old site of mine, I find that my rating system is no longer working properly like it used to. I made no changes to it and it just stopped working, so I assume this is due to some type of outdated code. I receive the following error when trying to update the rating database: Could not execute query : Resource id #4.Access denied for user 'user'@'10.%' to database 'database' I have checked and re-checked all of my passwords and account names and such, and I really can't figure out what's going on. The other parts of my site that work with the database have no problems accessing it and writing to it, it's only the Rating system that is having issues. I imagine my code will need to be seen, but hopefully one of you experts can give me some information based on the error it's giving. One more random question I had is regarding the entry of single quotes into text boxes for input into the database. If what I am putting in has a single quote in it anywhere, there's an error and the text isn't accepted. I figured out if I put a backslash in front of every instance of single quotes it'll go through, but that's kind of a pain and I know there's got to be an easier way. Thanks so much for your time and help! -b Quote Link to comment https://forums.phpfreaks.com/topic/227929-query-execution-error-and-single-quotes-questions/ Share on other sites More sharing options...
Pikachu2000 Posted February 16, 2011 Share Posted February 16, 2011 For your first issue, yes the code would be helpful. Just redact any actual usernames/passwords. The second issue is caused by failure to properly escape your data wiht mysql_real_escape_string, which also means you're probably wide open to SQL injection attacks. Quote Link to comment https://forums.phpfreaks.com/topic/227929-query-execution-error-and-single-quotes-questions/#findComment-1175355 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.