Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > Database & Database Programming

Database & Database Programming MySQL, Oracle, SQL, PL/SQL, ABAP, Smart Forms, and other databases and languages. A database is an organized body of related information used in many websites (including CC).

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-27-2006, 05:53 PM
Chrisms Chrisms is offline
Newbie
 
Join Date: Aug 2006
Location: NJ
Age: 19
Posts: 28
Rep Power: 9
Chrisms is on a distinguished road
Send a message via AIM to Chrisms
Default Database backup, with a twist.

Hey, I'm looking to backup my database, but, instead of saving it as a .sql or whatnot, havin git write PHP code to build the database. Is this possible? Do any of you know of any exsiting programs that will take a mysql database backup file, and build a php file to build that database? If not, i guess i'll have fun writing my own, just would be faster if i didn't have to write my own. haha.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 08-28-2006, 08:36 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,224
Last Blog:
Ext JS or Ext GWT
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

hmm, I'm not sure what you mean. You want a PHP app to build your database from a exported .sql file?

If so, you can just load the SQL from the backup file as a query and execute the query. When you export as SQL the SQL code in the file will execute as a query.

So basically build your fopen and do

PHP Code:
// Connec to SQL
.......

// Open/Read file
$fp fopen("sqlfile.sql","r");
$query fread($fp);

// Execute the query
$results mysql_query($query);

// close your connects
...... 
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-29-2006, 07:40 PM
falco85 falco85 is offline
Programmer
 
Join Date: Apr 2006
Posts: 105
Rep Power: 10
falco85 is on a distinguished road
Default

I think he is looking to export Jordan since he did say "Backup", right?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-29-2006, 08:47 PM
Chrisms Chrisms is offline
Newbie
 
Join Date: Aug 2006
Location: NJ
Age: 19
Posts: 28
Rep Power: 9
Chrisms is on a distinguished road
Send a message via AIM to Chrisms
Default

Quote:
Originally Posted by falco85 View Post
I think he is looking to export Jordan since he did say "Backup", right?
sorry, it's kind of not normal.

i have a database shell, with nothign in it. i want to make a backup of that database, only, instead of the normal backup file, i wish to have it be PHP'd, in the sense where you can run the .php file on ANY server, and it'll create the shell.

i wish to dstribute a program i'm making, (it's not nearly done yet, just thinking ahead.) and i don't want to rely on the end user to know how to use a .sql backup, rather have them ust go to a PHP file that creates the database, tables, etc, and then have them delete that file, to prevent dataloss in the future.

sorry i wasn't clear the first time around, i wish it had a name, it probably does, but i just dont know it..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-04-2006, 04:42 PM
Lop's Avatar   
Lop Lop is offline
Speaks fluent binary
 
Join Date: May 2006
Posts: 1,149
Rep Power: 18
Lop will become famous soon enoughLop will become famous soon enough
Default

ahh, so, will it be the same .sql file for every install? You could do an extract on your computer and just manually make it into PHP. Do what Jordan did above and just add the SQL into the PHP instead of using a file. That is what most commerical PHP applications do these days.
__________________
Lop
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 09-05-2006, 02:17 PM
Chrisms Chrisms is offline
Newbie
 
Join Date: Aug 2006
Location: NJ
Age: 19
Posts: 28
Rep Power: 9
Chrisms is on a distinguished road
Send a message via AIM to Chrisms
Default

Quote:
Originally Posted by Lop View Post
ahh, so, will it be the same .sql file for every install? You could do an extract on your computer and just manually make it into PHP. Do what Jordan did above and just add the SQL into the PHP instead of using a file. That is what most commerical PHP applications do these days.
you're missing my point, I really am not lookgin foward to sitting down, and writing roughly 500 lines of SQL create tables, collums, etc.

I'm looking for a program, that takes a database file, and outputs PHP to create that database.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving Access Database tigger Visual Basic Programming 0 07-06-2007 01:27 AM
Best program for SQL database manipulation Rhadamanthys Database & Database Programming 3 07-02-2007 03:32 PM
Best way to save lots of small values (in a database)? Vantage General Programming 2 05-14-2007 08:57 AM
Database and Database Users DevilsCharm Database & Database Programming 2 08-27-2006 11:22 AM
Shell: MySQL Database Backup Jordan Tutorials 0 08-15-2006 04:18 PM


All times are GMT -5. The time now is 12:25 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads