0

Hi..Wanna ask if someone knows how to retrieve records in database in PHP...I want that if i click the "retrieve button" all records will retrieve..I'll use retrieving when disaster occurs..tnx in advance.. :)

7
Contributors
13
Replies
17
Views
7 Years
Discussion Span
Last Post by harry_watson
-1

I have 5 PHP programs that work as web sites
window XP Prof SP3
(1) pilot's logbook access MySQL
(2) pilot's logbook access Oracle
(3) pilot's logbook access sql server 2008 express
Fedora 12
(1) pilot's logbook access MySQL
(2) pilot's logbook access Oracle

I can email

Voltaire: If God did not exist, it would be necessary for us to invent Him
GOD: If Voltaire did not exist, it would be necessary for us to invent him

0

?
Archives are usually used for disaster recovery!
That is such a genaral question, i don't think ther is an answer.

0

u dont need php script just to retrieve records... all you have to do is go to phpmyadmin and then export database and a sampledatabase.sql will be given to you. dont worry... its not a big file... it's just a plain text...

0

That is great! The resulting sql can regenerate the table with all constarints...right?

I presume you are talking about MySQL...right??

In MS SQL Server and Oracle, one can save a table(at least) and all constraints in XML.

Don't know about MySQL!

0

?
Archives are usually used for disaster recovery!
That is such a genaral question, i don't think ther is an answer.

oh ok..How can i work with that archive in php?

0

u dont need php script just to retrieve records... all you have to do is go to phpmyadmin and then export database and a sampledatabase.sql will be given to you. dont worry... its not a big file... it's just a plain text...

hmmm no i know what you're talking about with the phpadmin..but what i mean is when im done in my program,there's no more wamp server installed..only the program.website..coz i have my control panel.

0

try this:

<?php
mysql_connect("localhost","dbusername","dbpass");
mysql_select_db("databasename");

$sql = mysql_query("SELECT * FROM `tablename`");
$results = mysql_fetch_array($sql);

print_r($results);
?>

Is this what you want?

0

try this:

<?php
mysql_connect("localhost","dbusername","dbpass");
mysql_select_db("databasename");

$sql = mysql_query("SELECT * FROM `tablename`");
$results = mysql_fetch_array($sql);

print_r($results);
?>

Is this what you want?

no i just wanna know the code in retrieving records saved in database or maybe the right code for archiving records in php..

0

Oh well nice to see some code in this thread.
Here is some of the same if it is php Mysql you are looking for.

<?php
include ("../includes/dbconnect.php");
$tableName ="your_table";
$this = "this";
$sql="SELECT * FROM $tableName WHERE $this = 'this' ORDER BY first ASC";
$result=mysql_query($sql);
$rows=mysql_fetch_array($result);
while($rows=mysql_fetch_array($result)){ 
$result = this that and the other
?>

The SELECT * FROM this that and the other your_table_name is something to look at.
also would be good to know some more about the original question Hope to be useful H

Edited by harry_watson: forgot some syntax

0

unless you've used

INSERT * INTO your_table

and or

<form action="retrieve_file.php"

or something like it, we may be a bit off the track.

H

Edited by harry_watson: missing comma

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.