Jump to content


Embedding .php File Into Html Form Or Table

  • Please log in to reply
1 reply to this topic

#1 monkey64

  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 28 June 2006 - 09:13 PM

I’d better make it clear that I’m really new to MySQL and PHP programming.
I have a good working knowledge of HTML and CSS, but these two are tough languages!

All I want to do is display the contents of a field in a given database table in an HTML page. I’d like to show these contents either in an HTML table, or the text area element of an HTML form.

So far, I’ve created the following code which executes correctly from my .php page and displays the data as I wanted. However, I’m mystified as to how to embed this data into a table, grid, or text area element of an HTML form.

[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]<?php

// Make a MySQL Connection
mysql_connect("localhost", "realbab_mark", "coco") or die(mysql_error());
mysql_select_db("realbab_phpbb1") or die(mysql_error());

// Retrieve all the data from the "example" table
$result = mysql_query("SELECT * FROM phpbb_posts_text")
or die(mysql_error());

while($row = mysql_fetch_array($result)){
echo $row['post_subject'];
echo "<br />";

?> [!--colorc--][/span][!--/colorc--]

Can anyone help me before my head explodes!

#2 Buyocat

  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 28 June 2006 - 09:15 PM

Well you're in luck because something similar to your question has been answered... 4 times today. Follow this link and read what I posted, it should give you an idea on how to insert the HTML. In order to use a textarea you would just wrap the resulting column in a <textarea> tag, likewise for other stuff.

[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=97058\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=97058[/a]
Looking for some easy-to-use tools?  Try these, https://sourceforge....jects/utils-php -- I made them myself.  They're distinct tools which are easy to understand and use.  See some examples uses at http://www.anotherearlymorning.com

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users