| | 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 |
|
QUOTEIn 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 qu... read more.
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 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.
but auto installation really screws up yr theme if you decide to change the forums theme.....
hello.....he said he didnt have cpanel.....
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
I wasn't saying ut to you l33
oh i see...
Sure Mysql available
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". Latest EntriesQUOTE 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! 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.
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 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.
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.
Recent Queries:-
Keywords : execute, sql, file, create, table
(5) Do you think there will ever be a free Image, File, Video, and flash host all on one site? I doubt (8) i require a host to host files that has a good upload speed (unlike megaupload, sendspace) it (8) I have a signatue image I tried insert it using HTML -- BBCode EVERYTHING!! but it just (5) I upload files to the public folder under a new folder now if I want to link these files to (0) I have a script that during the install, I am to run a file that is supposed to load zip code data (3) Can someone tell me the files that are supposed to be under file manager...thanks!.... (0) Being a designer, sometimes it's easy to overlook the little things that you'll hate yourself for (0) I would like to know if is possible to cange the file of the "html imput file" with source code (16) Is there a file size limit on the upload? Cause I'm trying to upload a file size of 1.97mb and (4) How to use file manager in cpanel to upload a file from another web source. As my college does not (2) I deleted it cuzz I thought I didn't need it :S Please someone send me it!!!.... (12) Can I put some zip or rar file on the free hosting account? because I want to share some file with (7) i wanna share this web admin (file manager) written in php that i have downloaded in the script (6) I don't get that the File Manager works. I am not able to go up any file, I believe that has (2) Hello, When i enter my ftp or file maganer, I get NO directorys. Not even public_html or www or (3) how to use file().... (3) How to write to file such symbols like --> " / > <--- ?????.... (17) I put a file in public_html then I wanted to update it, so I uploaded the updated file (same name) (4) Any time wondered about what type of file was that one with weird extension? Your problem is no (15) Is ther any limit on a single files size? Thanks!.... (2) i was given a couple of audio files from my boss that he needs to listen to. they are transcripts of (3) ile Share pro is a Filesharing software as the name suggest > IT will setup an http server right in (6) the best way to start php is probably not adjusting a script IMO - that misses out a stage. - the 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 Looking for execute, sql, file, create, table
|
![]() How To Execute sql file to create table |