thenthornthing Posted December 23, 2008 Share Posted December 23, 2008 Hi, Right I'm not good with PHP so bear with me here... I basically have a portal powered by PHP that is fine and doesn't really involve my question... What I have is a mysql table which i need to insert a form into one of the pages of my portal so that my admins can fill it out, and then on another page the results of the table to be displayed, maybe formatted aswell... The pages can be either html or php, i have no idea whether they need to be a certain one. :s Cheers for your help in advance Link to comment https://forums.phpfreaks.com/topic/138153-inserting-mysql-table-into-html-document/ Share on other sites More sharing options...
ILMV Posted December 23, 2008 Share Posted December 23, 2008 The should both be using PHP if you want to interact with a database. Was that all you wanted? Happy Xmas! ILMV Link to comment https://forums.phpfreaks.com/topic/138153-inserting-mysql-table-into-html-document/#findComment-722152 Share on other sites More sharing options...
thenthornthing Posted December 23, 2008 Author Share Posted December 23, 2008 and how to actually insert the fields for the form into a php document ta Link to comment https://forums.phpfreaks.com/topic/138153-inserting-mysql-table-into-html-document/#findComment-722153 Share on other sites More sharing options...
Yesideez Posted December 23, 2008 Share Posted December 23, 2008 You'll be needing to call an INSERT query with mysql_query() http://www.php.net/mysql_query Link to comment https://forums.phpfreaks.com/topic/138153-inserting-mysql-table-into-html-document/#findComment-722163 Share on other sites More sharing options...
mattjones Posted December 23, 2008 Share Posted December 23, 2008 You need direct the form action of your html form to a php page eg formprocess.php then in formprocess.php use code similer to the following where 'textboxone' and 'textboxtwo' are the name="" sections of your html form elements. $tbox1=mysql_real_escape_string($_POST['textboxone']); $tbox2=mysql_real_escape_string($_POST['textboxtwo']); $sql="INSERT INTO tablename (column1,column2) VALUES ('$tbox1','$tbox2')"; mysql_query($sql); to print them out on a new page you need to use a SELECT * FROM tablename statement and echo the results this must be done with php matt Link to comment https://forums.phpfreaks.com/topic/138153-inserting-mysql-table-into-html-document/#findComment-722295 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.