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

  • Home
  • SEARCH
  • 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 299141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:47:45+00:00 2026-05-12T06:47:45+00:00

I asked similar question before and got some nice code, but i’m concerned with

  • 0

I asked similar question before and got some nice code, but i’m concerned with one of comments. I asked how to create and import mysql database from sql file in php on shared hosts. One of commenters said that some hosts might not allow me to do so from php. After digging a bit on other places someone suggested that I could create database from hosts control panel but import it by creating tables via php script executing sql queries this way:

         mysql_query("CREATE TABLE `TABLE NAME HERE` (
        `id` int(25) NOT NULL default '0',
        `CLMN NAME HERE` varchar(250) collate latin1_general_ci default NULL,
        `CLMN NAME HERE` int(10) default NULL,
        PRIMARY KEY  (`id`)
        ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;");

        mysql_query("INSERT INTO `TABLE NAME HERE` VALUES ('VALUE HERE', 'VALUE HERE', 'VALUE HERE');"); 

Could anyone comment on that? How do I achieve what i’m trying to do if given host will have restrictions on what i can do with databases in php?

(I’m not sure if creating new question for that is appropriate, but i thought that since previous question have good examples of doing it if host isn’t blocking everything i’ll create separate question for doing the same if host is more restrictive.)

  • 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-12T06:47:45+00:00Added an answer on May 12, 2026 at 6:47 am

    shared hosts and frequently do not allow you to create databases, except using their control panel. this is not uncommon, and it’s done for good reasons.

    and if you can’t do it from phpmyadmin or any other administration tool other than their control panel, you won’t be able to do it in PHP either.

    your only solution in that case is to create the database first using the host’s control panel, then edit your backup file and comment out the CREATE DATABASE statement before executing it.

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

Sidebar

Ask A Question

Stats

  • Questions 141k
  • Answers 141k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can simply use the methods of the WebClient class… May 12, 2026 at 8:08 am
  • Editorial Team
    Editorial Team added an answer "If you have a decimal place in your expression, you… May 12, 2026 at 8:08 am
  • Editorial Team
    Editorial Team added an answer I don't believe the ':hover' pseudo-class is implemented for anything… May 12, 2026 at 8:08 am

Related Questions

I asked a similar question before, and got some good answers, but I think
This is referring to the question i asked before, and got a really quick
I have some directories with a number of hidden files. One example of this
I have asked a similar question before and while the answers I got were
I asked something similar to this before and never got an answer, here's a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.