vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need PHP code for exporting *.sql (https://vborg.vbsupport.ru/showthread.php?t=46846)

tHE DSS 12-20-2002 10:02 PM

Yes, you can install it yourself.

But, I do recommend that Mascon over it any day of the week. For 100 reasons... apart from it not being Freeware. But $49 for somthing you'll be well glad you had in your tool box (for a long long time), is a pretty nice investment.

You will need to be taking backups of your database regular anyway. You may aswell have a smooth procedure for doing it.

Anyway, your original problem was that you didn't seem to be stating any connections to a database server, and not selecting a database.

Try somthing like this :

[sql]
$destinationLink = mysql_connect("destinationServerName", "username", "password") or die("Could Not Connect To DESTINATION database");
$connectDestination = mysql_select_db("destinationDatabaseName", $destinationLink) or die ("Could Not Select DESTINATION database");

$sqlEx = "sql"; //
$schema = "vbulletin"; //

$sql = explode(";", implode("", file("./".$schema.".".$sqlEx)));
for ($i = 0; $i < count($sql); $i++) mysql_query($sql[$i], $destinationLink) or die(mysql_error());
[/sql]

... Good luck. :bunny:

AZone 12-20-2002 11:26 PM

Thanks a lot! I did it!

Bubba 12-23-2002 04:02 AM

Some advice on using phpMyAdmin, if you can get the admin to only allow you and the "web user" access to it via file permissions. This prevents another user from being able to read the db password from the config files.

Also, when you're not using it, chmod the whole directory tree to 700. The prevents some random web user from accessing it when you're not using it.

And of course, don't use phpMyAdmin for the folder name......

If anyone knows any other good techniques to help safeguard this app, please let me know :)

Sebastian 12-23-2002 05:22 AM

I have that Mascon application, how do you schedule backup automatically? i don't see that option, i have the full version.

DrkFusion 12-23-2002 01:17 PM

Also if you have huge databases in phpmyadmin, when you try to import the huge sql file, you will get timeouts errors, you will have to use little snippets that phpmyadmin can digest it.

tHE DSS 12-23-2002 05:36 PM

Quote:

Originally posted by Sebastian
I have that Mascon application, how do you schedule backup automatically? i don't see that option, i have the full version.
You should be able to either use the application from the command line, or you will have a command line utility supplied with the package.

You can then create a little batch file, or somthing similar.

I got to admit though, the documentation with Mascon isn't all that hot. :ermm:

The developers would supply good support for it though.


All times are GMT. The time now is 06:18 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00946 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete