answersLogoWhite

0


Best Answer

Use the Select statement. As in

<?php

// If you want all of the data

$select = mysql_query("SELECT * FROM table_name"); // where table_name is name of your table

// If you want selected data

$select = mysql_query("SELECT id, username, password FROM table_name");

// If you want a particular data as in salary of employee named John from table employees

$select = mysql_query("SELECT salary FROM employee WHERE Name='john'");

// Remember This only selects the data. Now the fetch part

while($fetch = mysql_fetch_array($select))

{

// replace the column_name with name of the column fields in database

echo $fetch['column_name];

echo $fetch['column_name'];

}

?>

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you fetch the data from already stored database by using php code?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you retrieve data stored in the database into the textarea using ASP?

To retrieve data stored in a database and display it in a textarea using ASP, you can use a server-side script to query the database and fetch the data. Then, you can populate the value of the textarea with the retrieved data by echoing it within the textarea tag during the rendering of the page.


How do you fetch the data from database inside div tag using aspnet?

fggg


Database Design?

form_title=Database Design form_header=Transform your company by incorporating a new database design. What program will the database be used with?=_ Please explain what you will be using the database for?="" Do you have a database that you're already using?= () Yes () No


How do you save voice in database access?

I don't know but i need that information about how to store a voice as input for sql server 2005 and retrieve that using current input of voice.., I mean how two compare a already stored voice in database with given new input voice..,


How do you store pdf file to database using PHP?

Files cannot be directly stored in a MySQL database. However, a path to the file or the contents of the file can.


Database information is stored in?

information is stored in the data base using data structures.Data structures are programs that are designed to implement operations in a computer without necessarily subjecting the user to the comolexities of the process.


What types of computerized information or records are stored in a database?

A database can store various types of computerized information or records such as customer data, employee information, sales transactions, inventory levels, website content, and financial records. The type of information stored in a database depends on the needs and requirements of the organization using it.


Database?

form_title=Database Design form_header=Transform your company by incorporating a new database design. What program will the database be used with?=_ Please explain what you will be using the database for?="" Do you have a database that you're already using?= () Yes () No


How validate and retrieve data from database?

It is better to validate the data going into the database for errors rather then data coming out. The data to be retrieved can be done using the $_REQUEST or mysql_fetch_array or PDO statements. I am giving 2 simple examplesIf you want a particular data that can be obtained by using the where clause


Where are database used?

It would probably be easier to say where they aren't! Technically speaking, anything involving a list of some kind could probably be considered a database, but even in limiting to the electronic world, just about anything that stores and updates data of some sort probably does so using a database.


Basics of Database?

A database is a list of records, each record contains the same information in the same format as every other record. Using a database enables the user to find one or more records quickly and efficently, and to perform some calculations on the information stored.


What can be achieved from the database using forms?

what can be achieved from the database using reports