Syntax Errors With Apostrophe's

by 5 replies
6
I have successfully installed a JV giveaway script. However, I noticed that on certain pages as admin AND as a participant, it creates sql syntax errors regarding apostrophes. I can manually go in and resolve the problem by eliminating the apostrophes so I assume this is a quick fix somewhere but I am not "techy" enough to resolve. Any help about where to go, what to do, etc. would be greatly appreciated

Sincerely,

Craig
#programming #apostrophe #errors #syntax
  • Basically what that means is whoever coded the script was being lazy and did not properly sanitize the text inputs. In PHP, the value of a variable is put inside quotes (apostrophes), so whenever the script runs into a quote inside a variable, it thinks that the variable has ended... which will lead to all kinds of syntax errors.

    The fix is to sanitize the quotes in all variables before they are sent to the SQL database...

    PHP: htmlspecialchars - Manual

    Alternately, you could do this...

    http://php.net/manual/en/function.my...ape-string.php
    • [2] replies
    • Brandon,

      Thanks for the input. However, I still don't know exactly what this means or how to fix it. Where do I place any of this code? I am better at html so can this be done that way instead of trying to change the PHP script code itself? Sorry but I just don't want to screw up something

      Craig
    • Brandon,

      I basically need to know how to log into HostGator and resolve this via the html editor OR the PHPmyAdmin section with what to place where kind of a thing.
  • Your best bet would be to contact the script author.

    Brandon explained why your issue is occurring, but if you're not experienced enough to be able to even download, edit, and upload a file with FTP this is going to be an exercise in frustration for you. It's kind of like trying to fix a TV without knowing what a multimeter is or how to use it.

    There's no way that any of us could tell you exactly where to look or what to change without being able to see the code - even then it would take a while to trace exactly where the error is being introduced.
    • [1] reply
    • ^^ What Steve said. If you're not comfortable editing PHP / MySQL, then save your sanity and contact the script developer about this (or outsource the work to someone else who knows what they're doing).

Next Topics on Trending Feed

  • 6

    I have successfully installed a JV giveaway script. However, I noticed that on certain pages as admin AND as a participant, it creates sql syntax errors regarding apostrophes. I can manually go in and resolve the problem by eliminating the apostrophes so I assume this is a quick fix somewhere but I am not "techy" enough to resolve. Any help about where to go, what to do, etc. would be greatly appreciated Sincerely,