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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:13:07+00:00 2026-06-16T05:13:07+00:00

I’m a beginner programmer, and I’ve installed XAMPP with the intention of learning a

  • 0

I’m a beginner programmer, and I’ve installed XAMPP with the intention of learning a bit of PHP. I have a working knowledge of SQL.

I’ve been following the PHP tutorial at w3schools. The problem I am currently having is this: I’m using the script here to create a database and a table within it. What I’m using is almost verbatim, except I’ve replaced the user with “root” and I’ve deleted the password.

After running the script through the browser, the database my_db appears in the datafile for mysql in XAMPP.

However, there is no sign of a table, and when I try to select the table, I get

Table ‘my_db.persons’ doesn’t exist

What is going on? Is there something wrong with the code I took verbatim, or is it something with permissions?

It’s weird that the database is created but not a table…

  • 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-16T05:13:08+00:00Added an answer on June 16, 2026 at 5:13 am

    What has happenned is that your “CREATE TABLE” will have failed.

    Get into the habit of checking for errors after EVERY mySQL query (in your code): there are some times you can ignore errors, but it’s rare. So program alonghte lines of:

    Create query: $sql =
    Set parameters: $aParams =   (or bind paramters)
    Execute query
    If errors
        If debug: Show error and query
        If live: Log error and query
    

    I’m not giving the solution is code, as one problem with the tutorial you follow is that it uses mysql_() functions that are going to be depreciated shortly. You should use PDO (PHP Database Objects) or mysqli() functions otherwise your code will not work in a few releases time.

    With PDO, you can set error handling to use exceptions, and you wrap every call in try {} catch {} and this makes the habit of catching and reporting errors very easy.

        $sql = 'CREATE TABLE....';
        $aParams = array(
            ':param_name' => $param_value,
            ':param_name2' => $param_value2
               );
    
        try {
            $stmnt = $db->prepare($sql);
            $stmnt->execute($aParams);
            $stmnt = null;
        } catch (Exception $e) {
            // Error log here; $e contins line of error and the actual error, you have $sql and $aParams
            LogDBError($e, $sql, $aParams);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I have been unable to fix a problem with Java Unicode and encoding. The
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, 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.