executing .sql file

This is a discussion on executing .sql file within the alt.comp.lang.php forums, part of the PHP Programming Forums category; How do I execute a .sql file for creating a mysql database using php? THanks, Ike...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-30-2004
Ike
 
Posts: n/a
Default executing .sql file

How do I execute a .sql file for creating a mysql database using php?
THanks, Ike


Reply With Quote
  #2 (permalink)  
Old 01-30-2004
Tim Van Wassenhove
 
Posts: n/a
Default Re: executing .sql file

On 2004-01-30, Ike <rxv@hotmail.com> wrote:
> How do I execute a .sql file for creating a mysql database using php?


I assume the .sql file is only a text file containing mysql queries.

If you have access to a shell, mysql -u username -p < file.sql

If you don'th ave access to a shell, you could write a little script
that reads the file line by line, and calls mysql_query($line);

Or you could simply upload the file to phpmyadmin, ...

--
http://home.mysth.be/~timvw
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:44 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0