monkey64 Posted June 28, 2006 Share Posted June 28, 2006 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 Connectionmysql_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! Quote Link to comment https://forums.phpfreaks.com/topic/13154-embedding-php-file-into-html-form-or-table/ Share on other sites More sharing options...
Buyocat Posted June 28, 2006 Share Posted June 28, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/13154-embedding-php-file-into-html-form-or-table/#findComment-50595 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.