Jump to content

Such a Newb - Data Displayed in HTML ???


whitewolf007

Recommended Posts

Jeeze man i have tried snippets of code from different places and books etc

I just want to display a table of data from my database in an html table

I can connect to db, select db, query db

Now I need it to loop through each row and print the info there. 

Nothing I try seems to be working right

This has got to be about the most common thing ppl do with PHP and mySQL 

sigh......

???
Link to comment
https://forums.phpfreaks.com/topic/26277-such-a-newb-data-displayed-in-html/
Share on other sites

once you have the query in a variable like say, $rs, do this:

[code]
<?php
while($row = mysql_fetch_array($rs)){
  $msg .= "the format for each individual row's data here";
  $msg .= "using the array we just called like so";
  $msg .= "Comment Posted by ".$row['name'];
  $msg .= "or whatever column name you're using, for whatever";
}

//after you've done that just echo $msg

echo $msg;
?>
[/code]
Hello whitewolf007,

If you really get stuck try out my program, it's FREE!!! and EASY!!! (My Opinion)
http://www.iobe.net/proj/index.php?pg=downloads

I've been working on this program and am Dying to get someone to try it.  Hell, If you don't want to try it.
Give me the SQL to create you table and I'll give you the code it generates that will not only display the data but also insert, update, and delete it.

Regards,
John Sladek

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.