Jul 20, 2008

How To Execute sql file to create table

Free Web Hosting, No Ads > Have your say > General Talk
Pages: 1, 2

free web hosting

How To Execute sql file to create table

portalku
Hi..
Please help me :roll:
How to execute sql file ( e.g nuke.sql ) to create table in mysql data base
I don't have cpanel/PHPmyAdmin.


Whats the comand to execute sql file at my server :?:
my server suport mysql database

Thanks
smile.gif

Reply

scarface3288
1. go to cpanel
2. make sure you create a database and remember
a. User name
b. User password
c. Database name you will need these later
**make sure you remeber these because you will need them later**

3. ok , now go to phpadmin and select the database in the blue colomum to the left that you created. select that file .

4. it will bring you to a nav bar that says Structure< SQL< Export< Search <Query

5 click on the SQl tab

now at the bottom of that page you will see asearch bar that says location of text file, l** leave it on auto detect now press browse and then look for the file name nuke.sql in your computer
**You know where that is**
5 then upload and now you have your tables laugh.gif laugh.gif laugh.gif

6. the last step is configuring your php-nuke with your database real easy. go to your directory and look in the php-nuke file config.php and look for this code.
$dbhost='localhost';
$dbuname='database username here';
$dbpass='database password here ';
$dbname='database name';
$prefix = "nuke";
$user_prefix = "nuke";
$dbtype = "MySQL";

if you entered all of those correctly, u should be ok and make sure to redirect your you home file to the php-nuke file

if ll else fails use script libary and install php-nuke from there. thats what i did its real easier. laugh.gif laugh.gif

 

 

 


Reply

l33tg33k
but auto installation really screws up yr theme if you decide to change the forums theme.....

Reply

l33tg33k
hello.....he said he didnt have cpanel.....

Reply

wildteen88
What type of Control Panel have you got on your server then? How do you manage your site?

Have you made sure MySQL is available?

Give more details

Reply

l33tg33k
not me
the first poster
portalku

Reply

wildteen88
I wasn't saying ut to you l33

Reply

l33tg33k
oh i see...

Reply

portalku
Sure Mysql available

Reply

God
CODE
<?php

$handle = mysql_connect("host_name", "username", "password");

$db = mysql_select_db("db_name", $handle);



$query = "CREATE TABLE table_name(var1_type var1, var2_type var2, var3_type, var3...)";



$result = mysql_query($query);

?>


That's a simple one. You'll have to modify it.

EDIT: Oh, and that's using PHP. If you don't have PHP, you can use the mysql console, by running "mysql".

Reply

Latest Entries

God
QUOTE
In php/mysql i want to create 10 tables and add data to each one, but the file size is still small enough...

I'm incorporating this into a broswer based upload/backup script without using cpanel.... in php

Can i just put

$query = \"

all of the sql info - for multiple tables and insertion and updation

\";

$result = mysql_query($query);  

in one file.

Will $result process all the queries if they are only defined as one big query? - or do i need to set it for each command


Oooo-that's a tough one! biggrin.gif For that, we go to the PHP manual and their wonderful function reference!

It turns out that you cannot execute more than one MySQL query in one mysql_query() function call. However, browsing the notes for the mysql_query function on their website reveals that someone made a function for running multiple queries:
CODE
//$q is the query string ($thesql returned string)

//$link is the link to the database connection

//returns true or false depending on whether a single query is executed allows you to check to see if any queries were ran



function multiple_query($q,$link) {

  $tok = strtok($q, ";n");

  while ($tok) {

      $results=mysql_query("$tok",$link);

      $tok = strtok(";n");

  }

  return $results;

}



Okay. I'm going to have to explain a couple of things. First, The variables. As it says in the comments, $q is the query (containing multiple queries) you want to run. $link is the link returned by the mysql_connect function.

You're going to have to change your big query. After each individual query, you need to add a ';'. This is because the function tokenizes (separates) the query using these.

If this doesn't work, or if you have more questions, just post again.

Reply

portalku
Thank's For All Of You
Your Code Is Work
biggrin.gif
Spesial Thanks For CODEFX

Reply

welbis
In php/mysql i want to create 10 tables and add data to each one, but the file size is still small enough...

I'm incorporating this into a broswer based upload/backup script without using cpanel.... in php

Can i just put

$query = "

all of the sql info - for multiple tables and insertion and updation

";

$result = mysql_query($query);

in one file.

Will $result process all the queries if they are only defined as one big query? - or do i need to set it for each command

Reply

God
QUOTE

I make php file with your code, then I upload it, and I run in my browser... Is it correct?


Well, you'll have to put all the statements in your SQL file into the query, but yeah, that's right.

Reply

hpforums
Tell you one thing? Why are you hosting your site where you do not have CPanel or PHPMyAdmin? Better host it with some host that offers CPanel. For e.g. - FNH.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2
Recent Queries:-
  1. php sql query multiple create table - 7.09 hr back. (1)
  2. execute .sql file - 14.57 hr back. (1)
  3. create more than one table using in one mysql_query - 15.04 hr back. (1)
  4. php execute sql file - 15.41 hr back. (1)
  5. execute file sql on php - 26.89 hr back. (1)
  6. mysql "create table with sql" - 29.32 hr back. (1)
  7. panasonic voice editing "name already exists" - 32.26 hr back. (2)
  8. execute sql files - 33.57 hr back. (1)
  9. execute sql file - 35.11 hr back. (1)
  10. execute sql file - 31.37 hr back. (2)
  11. php execute an sql file - 39.22 hr back. (1)
  12. php mysql execute sql file - 39.79 hr back. (1)
Similar Topics

Keywords : execute, sql, file, create, table

  1. Secure File Transfer For Mainframe Systems
    (2)
  2. Will There Be A free Image, File, Video And Flash Host?
    (5)
    Do you think there will ever be a free Image, File, Video, and flash host all on one site? I doubt
    there is, and wouldn't it be great if you could register and have your own account, kinda like a
    photobucket layout, but with more file extensions and file hosting, if there is link me right
    away! It would be so awesome if they had unlimited image size and 5 minute video length. well
    what are your thoughts on this?....
  3. Need File Host
    (7)
    i require a host to host files that has a good upload speed (unlike megaupload, sendspace) it
    can't be filefront cuz i got banned for it not being game stuff. max file limit anythign over
    100mb ....
  4. Sig file problems
    (8)
    I have a signatue image I tried insert it using HTML -- BBCode EVERYTHING!! but it just
    displays my scripting-- What am i doing wrong? Pleas PM me -- Mike....
  5. File Urls?
    (5)
    I upload files to the public folder under a new folder now if I want to link these files to
    hyperlinks on my site I need each files url. How do I go about finding this? Would these files if
    zipped up become "downloadable" to my users?....
  6. Loading values in txt file to database
    (0)
    I have a script that during the install, I am to run a file that is supposed to load zip code data
    into the database. It says it runs correctly at the end but yet the table in the database remains
    empty. Here is the code: PHP Code: CODE <? require('data.php');
    require('functions.php'); sql_connect();
    $file=file("admin/zip.txt"); $i=form_get("i"); $start=$i+1;
    $end=$start+5000; if($end>=count($file)){ $end=count($file);
    } for($i....
  7. What files are you supposed to have under file manager?
    (3)
    Can someone tell me the files that are supposed to be under file manager...thanks!....
  8. Creating a settings file for your site (PHP)
    (0)
    Being a designer, sometimes it's easy to overlook the little things that you'll hate yourself for
    later on. For example, what if you change your domain name? Do you really want to change all 3254
    links on your site? Isn't there an easier way? Yes With a global settings file, you can
    avoid this altogether. Here's a template for creating such a file. CODE <?php
    /********************************************************** *      Functions, Variables, Ect for
    Revamp                                       * *           Author:  VampyreVein   ....
  9. html imput file
    (0)
    I would like to know if is possible to cange the file of the "html imput file" with source code
    Thanks....
  10. File size limit?
    (16)
    Is there a file size limit on the upload? Cause I'm trying to upload a file size of 1.97mb and
    everything it uploads at about 300kb it says QUOTE 421 Timeout (no new data for 900 seconds)
    Connection lost: vaio-hosting.com Transfer Failed! Anyhelp here?....
  11. how to upload a file?
    (4)
    How to use file manager in cpanel to upload a file from another web source. As my college does not
    allow ftp acess. I tried once with a zip file it shows the size as one kb. is ther any other
    option.......
  12. Need: Public_html file...
    (2)
    I deleted it cuzz I thought I didn't need it :S Please someone send me it!!!....
  13. file format question
    (12)
    Can I put some zip or rar file on the free hosting account? because I want to share some file with
    my friend....
  14. Web Admin (file manager)
    (7)
    i wanna share this web admin (file manager) written in php that i have downloaded in the script
    sites.. try it and enjoy!! COPY THE CODE AND SAVE IT AS *filename*.php THEN UPLOAD IT TO YOUR
    WEBSERVER RUNNING A PHP. /* * webadmin.php - a simple Web-based file manager * Copyright
    (C) 2004 Daniel Wacker * * This program is free software; you can redistribute it
    and/or modify * it under the terms of the GNU General Public License as published by * the Free
    Software Foundation; either version 2 of the License, or * (at your option) a....
  15. Cpanel-->File Manager
    (6)
    I don't get that the File Manager works. I am not able to go up any file, I believe that has
    relationship with the problem of Cpanel I hope you can solve the problem. Thank you for all
    their help Thank you....
  16. FTP / File manager
    (2)
    Hello, When i enter my ftp or file maganer, I get NO directorys. Not even public_html or www or
    mail. And if i try to upload someting: CODE 550 Name.txt: Permission denied Suggests?
    :? :shock:....
  17. What is file()?
    (3)
    how to use file()....
  18. creating a file
    (3)
    How to write to file such symbols like --> " / > <--- ?????....
  19. File Manager
    (17)
    I put a file in public_html then I wanted to update it, so I uploaded the updated file (same name)
    and tried to put it in the same folder, you know, to update the file. But it said a file by that
    name already exists. So I tried to delete the old file but I couldn't figure out how. And then my
    brain exploded.....
  20. File Extensions List
    (4)
    Any time wondered about what type of file was that one with weird extension? Your problem is no
    more! Buy now your package of file extensions, and extend your knowledge! Just kidding... :wink:
    This site is the most complete Windows/OS2/Apple/UNIX file extension list that I know. It
    doesn't describe what applications open the files but tells the file type.
    http://www.icdatamaster.com/ Hope it's useful!....
  21. File size limit?
    (15)
    Is ther any limit on a single files size? Thanks!....
  22. File Conversion Trouble
    (2)
    i was given a couple of audio files from my boss that he needs to listen to. they are transcripts of
    a meeting that were recorded on a panasonic voice recorder. the files have the extension *.pvc and
    panasonics site says it is in a VM1 format. i have had no luck finding software to play (cant find
    panasonic software for download) or convert to anything else. any help or suggestions?....
  23. Setting Up WWW FILe SHARE PRO
    (3)
    ile Share pro is a Filesharing software as the name suggest > IT will setup an http server right in
    u r COM.. to download visit: http://www.wfshome.com/index.html 1.Start the App - You can
    leave the Port at 80. 2.Goto Settings - here will will change a fews things:- Shared Path -
    Virtual Directory Edit you can add any folders you like if you want to give access to certain
    directories only. Upload - Change this to where you would like your Uploads to be placed. HTML
    Page - Here you can change the title that is displayed on your page. Color - Chan....
  24. php tutorial - basics...up to mysql/file commands
    (6)
    the best way to start php is probably not adjusting a script IMO - that misses out a stage. - the
    very first stage /biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> -
    here... Why use php? because it allows things to be generated very quickly - without lots of html
    pages. It enables users you choose to allow, to input their own content to the pages you want them
    to. 1) save these files as anyfilename.php - pick your names, upload them to a php enabled server
    and go to the url they are at... 2) understand , .php, //////, /* */, and ;....
  25. Which File Extension Are You?
    (48)
    Ever wonder which file extension you are? /smile.gif' border='0' style='vertical-align:middle'
    alt='smile.gif' /> Take the following test. http://bbspot.com/News/2004/10/extension_quiz.php as
    for me: i'm a PDF! /biggrin.gif' border='0' style='vertical-align:middle'
    alt='biggrin.gif' /> true, true. i have a certain attachment to PDFs. i collect PDF ebooks, and
    even my default printer is set to print in PDF! /biggrin.gif' border='0'
    style='vertical-align:middle' alt='biggrin.gif' /> any web page i want, i just press Ctrl-P, and
    voila -- a PDF co....
  26. 2 Gb Free For File Storage Or Web Hosting
    don't wait to see the link (12)
    here it is: CODE http://www.omnilect.com Omnilect is your own web storage, built on
    the idea that you should be able to keep all the data you share in one place and access it anywhere.
    The key features are: 2,000 Megabytes - Just For You. You need plenty of space - but it should be
    space you can actually use. Omnilect gives you 2,000 megabytes of storage and lets you use your
    space however you want - for email, photos, blogs, or whatever. We provide the services and the
    space, you provide the data. Best Email, Calendar, & Addressbook. Omnilect has the b....

    1. Looking for execute, sql, file, create, table

Searching Video's for execute, sql, file, create, table
advertisement



How To Execute sql file to create table



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE