Jump to content

displaying data


182x

Recommended Posts

Hey guys, sorry for all the n00bie questions however this time I am wondering how to display a set of data from a database. For example if the database has 4 columns cId, ty, dId, am and I would like to display all the information in a table where session id = dId. I can create the query but how do you actually display this information?

Thanks.
Link to comment
https://forums.phpfreaks.com/topic/27610-displaying-data/
Share on other sites

First off no question is a noobie question.  Here is what you want:

[code]

<?php

include( "header.php" );

$sql = "SELECT * FROM database_name";

$query = mysql_query( $sql );

  while ( $row = mysql_fetch_array( $sql ) ) {

            $data = "".$row["data"]."";

            print "Here is $data<br><br>";

  }

?>

[/code]

Tell me if it works, and good luck!

-Dan
Link to comment
https://forums.phpfreaks.com/topic/27610-displaying-data/#findComment-126267
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.