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 7709145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:47:29+00:00 2026-06-01T00:47:29+00:00

When I run my code I’m facing the next 2 errors: mysql_num_rows() expects parameter

  • 0

When I run my code I’m facing the next 2 errors:

mysql_num_rows() expects parameter 1 to be resource, boolean

That happens at rare lines of the file. Rest of them works just fine.

You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near ‘t ” at line 1

Yes, Its vulnerable, I see.
Its probably some weird charecters making up the issue, but I can really edit them, because I save the words to the db for md5ing them.

I assume mysql_real_escape_string will add some slashes which will give me another md5 value. So how can I not edit the datas and get the script secure at the same time?

require ("dbconnect.php");
$list = fopen("huge.txt","r");
//convert and save to db
while(!feof($list))
  {
  $word = fgets($list);

  //check if already in db.
  $check = mysql_query("SELECT id FROM `database` WHERE word='$word'") or 
  die(mysql_error());
  if (mysql_num_rows($check)==0)
     {
     //rest of the codes

I added die() just for me to see whats wrong.

  • 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-06-01T00:47:30+00:00Added an answer on June 1, 2026 at 12:47 am

    For question 1 you should simply, not pass any argument to the mysql_num_rows() if you only have one database connection.

    For question 2, the escaped version should not produce a different hash as long as it has been saved to the database, and then pulled from the database again. Once an escaped string is saved to the database, the saved version effectively loses the escape characters. This is why you do not see “they\’re” for example, when you pull escaped values from the database.

    Basically, when you initially create the hash, you should use a non-escaped version of the string for the hash input, then escape the plaintext version which can then be saved to the database. You can then pull the plaintext version from the database at any time, rehash, and it should create a matching hash value.

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

Sidebar

Related Questions

i need run code that will create a database and populate tables. i am
I'm trying to determine if something exists that allows you to run code in
I run next code and I miss somthing, for me it seem OK :
I have a code written in VB.Net that will run on multiple systems. One
I want to run code coverage in my unit tests. The issue is that
Our product contains a task-manager system that allows applications to run code in a
When I run code that deals with imageData being passed to a web worker
I am trying to run code of copying files in other thread so that
I'm creating an application that will run code in a sandboxed environment. This environment
I want to write code in Ruby witch net::ssh that run commands one by

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.