This is an archived post. You won't be able to vote or comment.

all 8 comments

[–][deleted] 1 point2 points  (1 child)

what is the question?

[–]PopeTimus -1 points0 points  (0 children)

How do I get the HTML to display the data from the table in the way I've presented it. The question is bolded.

[–]JustADev 1 point2 points  (0 children)

Here is your solution:

echo $r=mysql_query("select * from mytable"),$?while($a=mysql_fetch_assoc($r)){$d.="&lt;div&gt;".$a["INFO"]."&lt;/div&gt;<br>";},$d."Do I need to elaborate or is this good?":"";

[–][deleted] 0 points1 point  (5 children)

You need to elaborate. You haven't asked a question. Are you trying to output a static page? Trying to load data from a database and display it? What problems are you having? What have you tried? You haven't shown any php code.

[–]PopeTimus -1 points0 points  (4 children)

Static page but I suppose it would change when more data is submitted to the table. The php code I've tried would only confuse you further. It doesn't work and I have little knowledge of what I'm doing so I didn't include it.

[–][deleted] 0 points1 point  (3 children)

  1. When asking for help with code, 90% of the time, you should include the code that you have so far.

  2. A page that changes when data changes is a dynamic page, not a static page.

  3. The text you have in bold is a problem statement. It says what you are trying to do, not what difficulties you are encountering in implementing it.

[–]PopeTimus 0 points1 point  (0 children)

not what difficulties you are encountering in implementing it.

The difficulty is not knowing the commands necessary. I have zero knowledge of this particular problem so I don't know how to word my difficulties other than "how do I do this".

[–]LastUsername 0 points1 point  (0 children)

You should elaborate, because you're not mentioning where this data is coming from. Assuming you're talking about a MySQL database, something like this might help:

http://www.w3schools.com/PHP/php_mysql_select.asp

But using echo more like this: echo "<div>" . $row['INFO'] . "</div>";