![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #2 | ||
| "Paweł" <koral21@poczta.onet.pl> wrote in message news:<bek1bv$nut$3@news.onet.pl>... > > How to run thme with PHP? The simplest way is this: exec ('mysql -u user -p password dbname < script.sql'); If MySQL command line is not available, you can try something like this: // let's pretend we already connected to the server // and selected the database... $SQL = explode(';', implode ('', file ('file.sql'))); foreach ($SQL as $query) { $result = mysql_query ($query) or die ('The query: ' . $query . '<br>failed: ' . mysql_error()); } Obviously, it assumes that there are no semicolons in data, which may be a bit unrealistic... Cheers, NC | |||
| | #3 | ||
| > > How to run thme with PHP? > > The simplest way is this: > > exec ('mysql -u user -p password dbname < script.sql'); > > If MySQL command line is not available, you can try > something like this: > > // let's pretend we already connected to the server > // and selected the database... > $SQL = explode(';', implode ('', file ('file.sql'))); > foreach ($SQL as $query) { > $result = mysql_query ($query) > or die ('The query: ' . $query . '<br>failed: ' . mysql_error()); > } > > Obviously, it assumes that there are no semicolons in data, which > may be a bit unrealistic... > But I like the idea. The next question is whether when I several times call mysql_query what happens with mysql variables? Pawel | |||
| Featured Websites | ||||
|
![]() |
| Tags: multilines, mysql, script |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| running mysql script on remote host | Paweł | PHP | 0 | 07-01-2007 3:33 PM |
| Script completely owning my mysql server | ShishCoBob | PHP | 1 | 07-01-2007 3:19 PM |
| Login Invalid Script ASP/mySQL | StlyDan | Database | 0 | 05-31-2007 8:37 PM |
| Lines for Wii? | invisibleskull | Computer Consoles | 4 | 05-30-2007 10:05 PM |
| Featured Websites | ||||
|