Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6974927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:18:03+00:00 2026-05-27T17:18:03+00:00

I have no idea about PHP security, but if I add an ‘ to

  • 0

I have no idea about PHP security, but if I add an ' to the input in my POST method form.

I’m getting the following message:

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /usr/local/www/login.php

Is that a SQL injection? If so, how it can be abused by the “hackers” ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:18:04+00:00Added an answer on May 27, 2026 at 5:18 pm

    That means you’re vulnerable to SQL injection, and your code is not doing sufficient checking for errors.

    An absolute barebones “safe” bit of code would be:

    <?php
    ... connect to db ...
    $stringval = mysql_real_escape_string($_GET['param']);
    $sql = "SELECT somefield FROM sometable WHERE otherfield='$stringval'";
    $result = mysql_query($sql) or die(mysql_error());
    

    better yet is to stop using the mysql functions and switch to PDO and parameterized queries. They handle the injection problems for you automatically.

    The root cause of your error message is that your query has caused a syntax error. When a query fails outright like that, mysql_query() returns a boolean FALSE value, not a statement handle.

    Since you lack any kind of error checking, you blindly took that boolean false and passed it on to the fetch function, which has rightfully complained that you didn’t provide a result handle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a good idea about Agile development process but I have no ieda
I have basic idea about running PHP in different configurations like mod_php, cgi, FastCGI,
i want to implement comet in php... i have idea about how ajax works
I have no idea about PHP. I have PHP site hosted on Server A.
know nothing about php, but I have this script that reads a folder and
Anyone have idea about how to bind Boolean in sqlite with objective - c.
Anyone have any idea about CASlotProxy Class in Cocoa (iOS SDK)? I found it
Please let me know if you have any idea about it. Thanks EDIT What
I want to use a vertical UISlider . I have no idea about how,
I have a very little idea about what database file system is. Can somebody

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.