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
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]
Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.