Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 03-22-2007, 02:38 AM   #1 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
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?
Salchester is offline   Reply With Quote
Old 03-22-2007, 02:02 PM   #2 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
Sure.

How do you want to store it?
__________________

UT: Ultra-kill... God like!
DJMaze is offline   Reply With Quote
Old 03-22-2007, 03:32 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
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
sde is offline   Reply With Quote
Old 03-23-2007, 03:14 PM   #4 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
Since he's using xampp pack there's probably no password needed

mysqldump -uroot <dbname> > backupfile.sql
__________________

UT: Ultra-kill... God like!
DJMaze is offline   Reply With Quote
Old 03-31-2007, 11:52 AM   #5 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
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?
Salchester is offline   Reply With Quote
Old 03-31-2007, 01:56 PM   #6 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
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!
DJMaze is offline   Reply With Quote
Old 03-31-2007, 07:03 PM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
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
sde is offline   Reply With Quote
Old 04-01-2007, 07:06 AM   #8 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
What do you mean by user?

Many Thanks,
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote
Old 04-01-2007, 09:16 AM   #9 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
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
sde is offline   Reply With Quote
Old 04-01-2007, 03:16 PM   #10 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
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?
Salchester is offline   Reply With Quote
Old 04-01-2007, 03:19 PM   #11 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
Quote:
Originally Posted by Salchester View Post
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!
DJMaze is offline   Reply With Quote
Old 04-01-2007, 03:21 PM   #12 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
How?

Many Thanks,
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote
Old 04-01-2007, 03:25 PM   #13 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
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!
DJMaze is offline   Reply With Quote
Old 04-01-2007, 03:30 PM   #14 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
What Do I Need To Do After?

Many Thanks, much appreciated!!!
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote
Old 04-01-2007, 05:25 PM   #15 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
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!
DJMaze is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert HTML form data into mysql database ? plomon PHP 5 02-06-2005 08:23 AM
Can't see MySql database records in Mozilla monicao PHP 3 05-02-2004 05:19 PM
open another mysql database using phpMyAdmin infinite_root PHP 5 04-28-2004 08:04 PM


All times are GMT -8. The time now is 11:26 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting