Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

retreiving data from db

Posted on 2000-03-28
1
Medium Priority
?
223 Views
Last Modified: 2006-11-17
hi...
how can i retrieve data.
im using mysql/php:
<?
$sql="select * from user where id=7";
$databasename="appscan";
$tablename="user";
mysql_connect("haag","elad");
$result=mysql_query($sql);

?>
now...
how can i print the field value that
is from the query result?

how can i loop over the table, if i want
to retrive all info?

sorry...completely new...
im using ASP most of the time...
elad
0
Comment
Question by:eladr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
RHJennings earned 20 total points
ID: 2664259
You can use this to loop though the values, then display them.

while ($row=mysql_fetch_object($result)) {
            echo $row->[field value to display]
      }

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question