answersLogoWhite

0


Best Answer

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 examples

// The connection string or function here to connect to database

// Put the name of your database in place of db_name

mysql_select_db("db_name");

// Enter the name of table in place of table_name

$query = mysql_query("SELECT * FROM table_name");

while($fetch = mysql_fetch_array($query))

{

// add your table column names in the square blocks

echo $fetch['Name']."
";

echo $fetch['email']."
";

}

?>

If you want a particular data that can be obtained by using the where clause

The ID would come from user input

$data = $_REQUEST['ID'];

// Enter the name of table in place of table_name

$query = mysql_query("SELECT * FROM table_name WHERE ID='$data'");

while($fetch = mysql_fetch_array($query))

{

// add your table column names in the square blocks

echo $fetch['Name']."
";

echo $fetch['email']."
";

}

?>

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How validate and retrieve data from database?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you validate and retrieve data from database?

How do you validate and retrieve data from database?" How do you validate and retrieve data from database?"


How do retrieve data from database in c?

nbbmnbmn


How validate and retrieve data from database in jsp?

We can do validation by using JavaScript. Here we are using function Validate(). Iam creating one JSP name index.jsp & give a link to another JSP name basic.jsp. In that Jsp iam using Type 1 Jdbc Driver & giving a database connection


What database objects allows you to search for and retrieve data?

SQL queries allow you to search for and retrieve data from a database. By writing SELECT statements with specific criteria, you can search for information in tables and retrieve the results based on your query.


What is the term used to check the correctness of the data in a database or spreadsheet application?

validate


Data conversion and loading in database?

By data conversion we mean the data is first processed. The data after processing is ready to store in database. And from the database we can retrieve it for our use.


What is the select element?

To retrieve or modify data in the database query are used. There are four types of commands in SQL. Select command is data retrieval language command and is used to retrieve data from a database.In database there Four types of languages which contains various commands. Select command is the only command that is used for retrieval of data.


What is a request for data from a database is called?

A request for data from a database is called a query. It is a command that is used to retrieve specific information from the database based on certain criteria.


What software allows the user to enter retrieve and update data in an organized and efficient manner?

Any application that lets you save and retrieve a file. My best guess is that you are looking for database as an answer.


What software tool can be used to create a database add change and delete data in the database sort and retrieve data and create forms and reports using the data in the database?

datebase management system


What allows you to store retrieve analyze and print information stored in a database?

A database management system (DBMS) is used to store, retrieve, analyze, and print information stored in a database. It provides functionalities to efficiently manage data, ensure data integrity, and support various operations such as querying and reporting on the data stored in the database.


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.