Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 15th, 2008, 06:19 AM
Registered User
 
Join Date: Dec 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default code for database backup???

hello everybudy,
i am begginer in php, i hv two problems right now
1) i developing a site in which flat_no is same and i want to insert multiple member name and their blood group resp(with same flat no)....by using single textbox!
2) i wanna take backup of database!!!
can anybudy provide me the code for my problems.....
plz help me out...
Thank you.
 
Old December 17th, 2008, 10:56 PM
Registered User
 
Join Date: Dec 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
multiple member ... using single textbox!
Example:


Input page
HTML Code:
...
<form action="savedata.php" method="post">
    <textarea name="patientdata"></textarea>
    <input type="submit" value="Save"/>
</form>
...
Save page
(example name: "savedata.php")


PHP Code:
<?php

// After testing, delete row below
$testdata "Barack Obama, A; Jorge Bush, AB; Bill Clinton, B";

/*
    Please always use a Secure Server and think's like SSL / HTTPS for Patient Data
*/

//HTML Form input

//temp off for single page test
/*
if (isset($_POST["patientdata"])){
    $pdata = $_POST["patientdata"];
} else {
    die("Please fill field Patient Data");
}

//Your SQL injection protection
//$pdata

*/



// After testing, delete row below
$pdata $testdata;

// Change explode to your own format
$PatientsArray explode(";"$testdata);

// After testing, delete row below
var_dump($PatientsArray);

foreach (
$PatientsArray as $key => $value) {
    
// And so on...
    // 
    
    
$SinglePatientArray explode(","$value);
    
    
//Your valid data test funtions
    // for $SinglePatientArray
    
    // After testing, delete row below
    
var_dump($SinglePatientArray);
    
    
/*
    $query = sprintf("mysql insert query", $SinglePatientArray[0], $SinglePatientArray[1]);
    mysql_query($query);
    */
}

?>
Quote:
...take backup of database...
http://www.phpmyadmin.net





Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Backup compad ASP.NET 2.0 Basics 1 February 5th, 2008 11:06 AM
backup of database MunishBhatia SQL Server 2005 0 October 5th, 2007 04:20 AM
Backup Database gaurav_jain2403 SQL Server 2000 0 August 3rd, 2006 12:57 AM
Database Backup [email protected] General .NET 1 February 17th, 2006 08:41 AM
Backup database hlchuah77 SQL Server 2000 4 December 5th, 2004 11:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.