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

Related Questions

I have asked a similar question before, but I didn't have a firm grasp
I asked a similar question about this previously, but I did not specify that
Liu Chang asked a very similar question to this one here, Linux equivalent of
A similar question has been asked: MSDN subscriptions on the cheap? , but I
Similar questions to this one have been asked but none seem to address my
A similar question was already asked ( Performing a Stress Test on Web Application?
Similar questions have been asked, but nothing exactly like mine, so here goes. We
I didn't see any similar questions asked on this topic, and I had to
Any recommended crypto libraries for Python. I know I've asked something similar in x509
When asked to create system XYZ and you ask to do it in Python

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.