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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:42:06+00:00 2026-06-18T07:42:06+00:00

I am trying use mysqli functions but I get this error: Fatal error: Call

  • 0

I am trying use mysqli functions but I get this error:

Fatal error: Call to undefined method mysqli::num_rows() in C:\AppServ\www\edu\files\header.php on line 19

I tried to go to php.ini and remove ; from extension=php_mysqli.dll
I found it already removed

I tried to restart appachi;
the connection file:

// db username
define("USERNAME","root");

// db password
define("PASSWORD","root");

// db servername
define("SERVERNAME","localhost");

// db name
define("NAME","edu");

//connect to db
$mysqli = new mysqli(SERVERNAME,USERNAME,PASSWORD,NAME);
if ($mysqli->connect_errno) {
    echo $cannot_connect;
}

//select db encoding
$mysqli->set_charset('utf8');   

calling function in a file:

$sql = $mysqli->query("SELECT VALUE FROM SITE_CONFIG WHERE CONF='KEYWORDS'");
if (!$sql) {
    echo "Failed to run query: (" . $mysqli->errno . ") " . $mysqli->error;
}
if($mysqli->num_rows($sql) > 0){
    while($rs = $sql->fetch_assoc()){
        $keyw = $rs['VALUE'];
    }
}else{
        $keyw = $no_data;
}

note : I included connection.php

  • 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-18T07:42:07+00:00Added an answer on June 18, 2026 at 7:42 am

    Try:

    $sql = $mysqli->query("SELECT VALUE FROM SITE_CONFIG WHERE CONF='KEYWORDS'");
    if (!$sql) {
        echo "Failed to run query: (" . $mysqli->errno . ") " . $mysqli->error;
    } else {
        if($sql->num_rows > 0){// here must be $sql , not $mysqli
            while($rs = $sql->fetch_assoc()){
                echo $rs['VALUE'];
            }
        } else{
                echo "No data";
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying for days to get this working.. but i still fail. <?php $province
I am trying to use mysqli and it has been giving me an error
The following error is returned when trying to use a MySQL function.. #1418 -
I'm trying to use a MySQL database to save player information, but whenever there
I am trying to use this MySQL query: SET @a:=0; UPDATE tbl SET sortId=@a:=@a+1
I'm trying to use the PDO MySQL driver in my CodeIgniter application. This is
I am trying to select a table within my database with a GET Method.
I'm trying to use mysql_real_escape_string() to secure a log in form. Using this code:
I'm trying to connect to Mysql database with following Php code. But I get
I'm trying to use the jQuery UI to style my HTML select menu but

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.