|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Member
Join Date: Sep 2005
Posts: 18
|
Execute an SQL file
Hey everyone I have an SQL file I would like to execute, is there any easy way of doing this without using
system("mysql -uUsername -pPassword dbname < file.sql"); Basically it's a whole bunch of this: Code:
DROP TABLE IF EXISTS downloads; CREATE TABLE downloads ( teacherid bigint(100) NOT NULL default '0', url varchar(255) NOT NULL default '', title varchar(255) NOT NULL default '', visible char(1) NOT NULL default '1', section varchar(50) default 'General', path varchar(255) NOT NULL default '' ) TYPE=MyISAM; # -------------------------------------------------------- # # Table structure for table `homeworkapr` # DROP TABLE IF EXISTS homeworkapr; CREATE TABLE homeworkapr ( teacherid bigint(20) NOT NULL default '0', period char(3) NOT NULL default '', d1 text, d2 text, d3 text, d4 text, d5 text, d6 text, d7 text, d8 text, d9 text, d10 text, d11 text, d12 text, d13 text, d14 text, d15 text, d16 text, d17 text, d18 text, d19 text, d20 text, d21 text, d22 text, d23 text, d24 text, d25 text, d26 text, d27 text, d28 text, d29 text, d30 text, d31 text ) TYPE=MyISAM; # -------------------------------------------------------- - Jeff |
|
|
|
|
|
#2 |
|
Web development Company
![]() ![]() ![]() ![]() ![]() Join Date: Jan 2001
Location: chennai , tamil nadu , India
Posts: 710
|
If you have PHPmyadmin installed in your server, you could upload this sql file too.
|
|
|
|
|
|
#3 |
|
dooby dooby doo
![]() ![]() ![]() Join Date: Aug 2004
Location: Manchester UK
Posts: 11,240
|
You can just put it into a mysql_query().
PHP Code:
|
|
|
|
|
|
#4 |
|
SitePoint Zealot
![]() ![]() Join Date: Sep 2005
Posts: 166
|
phpMyAdmin
I like it |
|
|
|
|
|
#5 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Sep 2005
Location: miDDle oF NoWHere
Posts: 222
|
you can also use SQLYog... google for sqlyog download for the latest version
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 21:37.












Linear Mode
