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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:21:53+00:00 2026-05-13T19:21:53+00:00

Here’s the problem: I started a swap today to use mysqli. No biggie, just

  • 0

Here’s the problem: I started a swap today to use mysqli. No biggie, just had to change a few statements. Everything went fine, no errors… Except that I can’t get it to execute any queries at all. I have double and triple checked my syntax. I even started creating situations where it SHOULD return an error (Trying to get it to INSERT to Tables that don’t exist or with values that exceeded column limits or didn’t match type) and… nothing. It doesn’t return an error, it doesn’t write. It WILL complain if parameter one is NOT a mysqli type.

Here’s the relevant code:

$con = mysqli_connect("localhost", "root", "","test");

if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}

$query = "INSERT INTO files VALUES (NULL, 5, 'hello')";
mysqli_query($con, $query);

And nothing. It runs without a problem, but it never writes the record. I can even change the $query to “hdjhkfhhjfkd” and it runs no problem. mysqli_query() just isn’t executing, period. The only time I can get it to react is if I change $con to anything else, then it complains that it needs a mysqli type.

Thoughts? THis is driving me bonkers.

  • 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-13T19:21:53+00:00Added an answer on May 13, 2026 at 7:21 pm

    Have you checked the return value of mysqli_query()? It returns FALSE if an error occurred. In that case mysqli_error() gives you more information about the error.

    <?php
    $con = mysqli_connect("localhost", "root", "", "test");
    if (mysqli_connect_errno()) {
      printf("Connect failed: %s\n", mysqli_connect_error());
      exit();
    }
    
    $query = "INSERT INTO files VALUES (NULL, 5, 'hello')";
    echo "<pre>Debug: $query</pre>\m";
    $result = mysqli_query($con, $query);
    if ( false===$result ) {
      printf("error: %s\n", mysqli_error($con));
    }
    else {
      echo 'done.';
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my problem : I have a post controller with the action create.
Here is an example: I write html code inside of textarea, then I swap
Here my problem: @Assert\Regex( * pattern=/^[A-Za-z0-9][A-Za-z0-9\]*$/, * groups={creation, creation_logged} * ) I'm using the
Here is the problem that I am trying to solve. I have two folders
Here is my class: public class A{ private void doIt(int[] X, int[] Y){ //change
Here is my problem: My Spring MVC website is going to rely a lot
Here's the code require_once 'functions.php'; require_once 'cfg.php'; $mysqli = new mysqli($dbhost, $dbuser, $dbpass, $db);
Here is my problem.. I have the option to create(add) two new input fields,
Here is my error(if you need any more info just ask)- Error SQL query:
Here's the code I have. It works. The only problem is that the first

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.