database exporter

Started on the old forum in October 2010 · view the original in the archive · old links redirect here

#database #export #funmobile #lavalair #sql

13 replies · 993 views · started 16 years ago · 1 min read

6 participants
pmbguy Senior · 344 posts #1

ok, dunno if anyone has coded anything similar to this yet, but if they have which i'm sure someone must have, here's another share...

ok, i often spend long amounts of time either capped, ie: unable to access my server from my pc, or away from home, so i thought it would be pretty neat having a portable database backup tool... and preferably one i don't need to login to cpanels or funny stuff but could access using my owners tools or stash in some innocent looking file or unlinked action kinda thing...

took me a while to get it to work out so the database export could be imported and a few litres of coffee, but NOW, as i prepare my next cuppa I'm happy to bring you this...

The function isn't entirely my work, but i took the liberty to name it anyways, lol...

Attachments: db_backup_tool.rar
shakil420 Developer · 125 posts #4

NOT WORKING @ my localhost [wamp]

create("$filedname", PCLZIP_OPT_REMOVE_PATH, "$folder", PCLZIP_OPT_ADD_PATH, 'backup'); if ($v_list == 0) { die("Error : ".$archive->errorInfo(true)); } echo "Database Backed Up
Download Zipped File
Click Here

click here herf == http://127.0.0.1/kekz1/wap/%5C%22%5C%22 ?????? /// simple its not work


  1. whats the problem ? 2.is it not works on wamp ?

@ pmbguy

pmbguy Senior · 344 posts #5

i got no idea why it doesn't work on wamp...

I canb tell you it does work... i've exported my database a few times... even managed to download trhe exported copy with opera, which had gioven me a few problems previously...

I'll set up a demo, give me a few minutes...

Added after 12 minutes:

ok, well as for the wamp error, i got no idea... wamp always gives problems... Like i got a few things that never work on wamp but work great on server...

ok, you think i was lying i'm guessing, so here's proof,

http://wapwarrior.co.cc/db_test

if you're hoping for some juicy database stuff, I'm sorry i uploaded a blank database there... but try the url and you'll see my script in action...

Added after 13 minutes:

ok, i updated it to make it a bit more self sufficient, ie: stand alone cause i copied the db info from core n config.php...

anyways, here you go... maybe this will work with wamp... (if it still doesn't, try the demo link i put up...)

Attachments: db_backup_tool.zip
ayoomo9 Junior · 12 posts #7

Nice idea, though i've not yet test it on my server.

pmbguy Senior · 344 posts #9

ok, i've done a bit more updating... now you can send backed up via email...

still gotta try make the code a bit more tidy before i post it up here though

Added after 2 minutes:

one question though, does anyone here have an email attachment function that works, i been trying different examples for hours... in the end i resorted to using someones script cause it didn't need attachments to be uploaded, but it's driving me nuts, lol

pmbguy Senior · 344 posts #10

ok, after doing a minor update, you can now email database to yourself too...

I've been asked how it works, so here goes:

the line with my coders notice changes...

echo "Database Backed Up<br/>Download Zipped File<br/><a href=\"$randname\">Click Here</a><br/><br/>Send Via Email<br/><a href=\"sendfile.php?fileurl=".$file2url."\">Click 2 Email</a><hr/>(c)oded by pmbguy 2010"; //please leave coders notice if you add it to tools, etc...

and you add sendfile.php to the directory and add a variable there to carry the $fileurl to the send url box...

sendfile.php is available with instructions from authors page: PHP Send File By Email

hope this helps

Mysterio Lead · 630 posts #11

I tested on Wamp and Xamp and it works (latest version).

One thing that does't work is, when getting some values which may have ' sign or " sign. The code becomes unreadable when trying to import that database later.

mysterio.al - programming is a functional art

Mysterio Lead · 630 posts #13

pmbguy wrote: well, my ' " etc get changed to html symbol codes before getting posted to database, that should solve the problem...

Hmmm... Well, you inspired me for my CMS (in developing progress) to make and one-click db backup and restore.

By the way, I have hundred INSERT queries in my code and I POST/GET/REQUEST thousand values. How to change them all (some code which handles all values) and be treated as html symbols?

mysterio.al - programming is a functional art

rockman Junior · 20 posts #14

when im downloading the backup its always 144b and zero database bytes. How to fix that? Thanks

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close