|
 |
|
 |
03-22-2007, 02:38 AM
|
#1 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
PHP:Save MySQL Database
Howdy Everyone,
Using MySQL along with PHP, is it possible to save information stored in a database to a text file, then at a later date, load the text file data back into the database?
Many Thanks,
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
03-22-2007, 02:02 PM
|
#2 (permalink)
|
|
Senior Contributor
Join Date: Mar 2005
Posts: 651
|
Sure.
How do you want to store it?
__________________

UT: Ultra-kill... God like!
|
|
|
03-22-2007, 03:32 PM
|
#3 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,446
|
there's a system command to backup your database (not a mysql_query command)
Code:
mysqldump -u<username> -p<password> <dbname> > backupfile.sql
there's a tutorial in the php section on how to dynamically load a mysqldump file too.
__________________
Mike
|
|
|
03-23-2007, 03:14 PM
|
#4 (permalink)
|
|
Senior Contributor
Join Date: Mar 2005
Posts: 651
|
Since he's using xampp pack there's probably no password needed
mysqldump -uroot <dbname> > backupfile.sql
__________________

UT: Ultra-kill... God like!
|
|
|
03-31-2007, 11:52 AM
|
#5 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
PHP: Save MySQL Database
I searched around "Code Newbie", and came across the page at the following URL, on how to create .txt files using PHP.
Creating TXT Files
Can information from within forms, be stored to a text file, and can the text file be stored anyway on the computer, for example the root directory of drive "c:/"?
Many Thanks,
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
03-31-2007, 01:56 PM
|
#6 (permalink)
|
|
Senior Contributor
Join Date: Mar 2005
Posts: 651
|
Yes and no, it all depends on your OS security policy.
But since you're using Windows OS i doubt you've set one up, so yes you can.
And if you do understand Windows and did setup a security policy there's a 26% change the password is the name of one of your kids. If not, then 12% change it's your lover.
Oh and probably the password is written down on a note-it that sticks on the monitor. Now how can you forget the name of your kids 
__________________

UT: Ultra-kill... God like!
|
|
|
03-31-2007, 07:03 PM
|
#7 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,446
|
i sometimes am not sure how to take DJMs posts, but they can certainly come across as condescending.
salch, as DJM said, yes it's possible, but the directory you want to write to must be writable by the web user. i don't know what user apache runs as under an XAMP system.
__________________
Mike
|
|
|
04-01-2007, 07:06 AM
|
#8 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
What do you mean by user?
Many Thanks,
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
04-01-2007, 09:16 AM
|
#9 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,446
|
when you run a program, the system runs it as your user (whatever you login to windows with)
your web server also runs as a user, but it may or may not be your own username.
you can do a ctrl+alt+delete and view your processes. look for the apache process and it will show that user it's running as in the 'User Name' column.
if you don't see the user name column, you can go to View->Select Columns in the windows task manager.
__________________
Mike
|
|
|
04-01-2007, 03:16 PM
|
#10 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
SDE,
How do I go about storing information from a form inside a text file?
For example a persons name, from a text box.
How can the information be encrypted.
Many Thanks,
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
04-01-2007, 03:19 PM
|
#11 (permalink)
|
|
Senior Contributor
Join Date: Mar 2005
Posts: 651
|
Quote:
Originally Posted by Salchester
How can the information be encrypted.
|
WoW, shouldn't you first learn about securing your server before overloading it with encryption methods like blowfish?
__________________

UT: Ultra-kill... God like!
|
|
|
04-01-2007, 03:21 PM
|
#12 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
How?
Many Thanks,
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
04-01-2007, 03:25 PM
|
#13 (permalink)
|
|
Senior Contributor
Join Date: Mar 2005
Posts: 651
|
1. Download CentOS iso cd's or dvd (choose i386 for intel 32 bit or x86_64 for 64 bit)
2. Burn them on cd/dvd
3. Reboot and install (make sure to check Apache and other webstuff at install)
After that you have a secure system, which is much easier then to explain you in this topic how Windows security works.
__________________

UT: Ultra-kill... God like!
|
|
|
04-01-2007, 03:30 PM
|
#14 (permalink)
|
|
Salchester
Join Date: Jul 2005
Location: In a house
Posts: 230
|
What Do I Need To Do After?
Many Thanks, much appreciated!!!
__________________
Many Thanks, in advance!
Salchester.
The Future Is Here - Are You Ready?
|
|
|
04-01-2007, 05:25 PM
|
#15 (permalink)
|
|
Senior Contributor
Join Date: Mar 2005
Posts: 651
|
CentOS is an Operating System just like Windows is.
It has all the tools you currently use for a server like Apache, MySQL and PHP.
So after install (windows is gone) there's nothing you need to do, other then developing your website.
Then you will notice where and where not you may store files on the system thru PHP since the system is already protected.
After that we could guide you how to use encryption as used with:
- PHP: crypt - Manual
- PHP: md5 - Manual
- PHP: sha1 - Manual
- PHP: gnupg Functions - Manual
- PHP: hash Functions - Manual
- PHP: Mcrypt Encryption Functions - Manual
Windows is a mess if you want to properly setup a server with your scripts.
You need IIS knowledge since Apache will not provide the security on Windows.
__________________

UT: Ultra-kill... God like!
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 11:26 PM.
|
Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
|
 |
|