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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:09:43+00:00 2026-05-28T03:09:43+00:00

require(includes/connect.php); $result = mysql_query(SELECT * FROM entries, $link); while ($row = mysql_fetch_array($result)) { htmlentities($row[‘quotes’]);

  • 0
require("includes/connect.php");

            $result = mysql_query("SELECT * FROM entries", $link);

            while ($row = mysql_fetch_array($result)) {
                htmlentities($row['quotes']);
            }

I am trying to display data that is in the database, but I keep on getting:

Warning: mysql_real_escape_string() expects parameter 1 to be string

Is there anything wrong in the above code that is causing the problem? I am quite new to PHP and I am trying to understand what’s going on and why it’s doing it.

connect.php

$link = mysql_connect("localhost", "root", "");

    if (!$link) {
        die("Could not connect to the db");
    }

    mysql_select_db("ENTRIES",  $link);

(I’m working on this locally, so user/pass really isn’t important right now)

  • 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-28T03:09:44+00:00Added an answer on May 28, 2026 at 3:09 am

    I don’t see the point with escaping the above query, but you could do it like this:

     $result = mysql_query(mysql_real_escape_string("SELECT * FROM entries"), $link);
    

    You should read the documentation: mysql_real_escape_string()

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

Sidebar

Related Questions

function sitemap_galerija($tablica) { require(include/konekcija.php); if($tablica == 'kategorije') { // Connect do database ... while($row
The error occurs on line 65: } catch (Exception $e){ <?php require includes/connect.php; function
I have a PHP file /a/b/file.php with the line require(../connect.php); In connect.php there is
In my live site I have php include() and require() that have full path
Is there any way to include php file using require and calling a php
In PHP: When should I use require vs. include ? When should I use
I am using PHP in eclipse. It works ok, I can connect to my
<?php require_once includes/db_data_inc.php; try { /* In this way I get a db connection
I need help with posting a value to a php script from a js
My file includes/global.inc.php contains info about the DB and it is just like below

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.