Jump to content

Getting Data from MySQL Row in the database, and displaying on web page


echoindia756

Recommended Posts

Hi there,

 

I'm having a bit of trouble getting something to work. Basically, I have several fields in a table:

 

"Item Name" and "Item Price"

 

These values are dynamic to each user (so different items will appear depending on your username),

I want to retrieve this information from the database row and put it into a HTML table on the users homepage on my website

 

So for example the data would appear like this:

 

Item Name              Item Price 

Digital Camera            €40.00

Underwater Camera      €50.00

 

So I think the mysql query would be something like:

 

mysql_query("SELECT * FROM table_name WHERE user_id = $_SESSION['user_id']");

 

But i'm not sure how to get all the users items to display on the table, could someone help me with the PHP code please?

I'd really appreciate it!

 

Thanks in advance!

Hi thanks for that!

I think I almost got it working, the problem I am having now is that if there is more than one row in the table, it only displays one of the rows on the html table, is there anyway to display all of the rows that are in the table?

 

Many thanks for your help.

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.