Rub Posted August 19, 2009 Share Posted August 19, 2009 I don't know how I do this.. So.. I got 3 textarea's for the content of the post How do I get these 3 textarea's into 1 output for the database => content? This is what I have been trying.. What is the right way to do it? $title = mysql_prep($_POST['title']); $contentArray = array("$_POST['textarea2']", "$_POST['textarea3']", "$_POST['textarea4']"); $contentEnter = join("/n", $contentArray); $content = mysql_prep($contentEnter); $query = "INSERT INTO posts (title, content) VALUES ('{$title}', '{$content}')" Quote Link to comment https://forums.phpfreaks.com/topic/170957-solved-multiple-textareas-into-one-mysql-prep-splitted-by-an-enter/ Share on other sites More sharing options...
JonnoTheDev Posted August 19, 2009 Share Posted August 19, 2009 Only require 1 line. Make sure that you have validated that there is input in each of the textareas prior. <?php $content = implode("\r\n",array($_POST['textarea2'], $_POST['textarea3'], $_POST['textarea4'])); ?> Quote Link to comment https://forums.phpfreaks.com/topic/170957-solved-multiple-textareas-into-one-mysql-prep-splitted-by-an-enter/#findComment-901705 Share on other sites More sharing options...
Rub Posted August 19, 2009 Author Share Posted August 19, 2009 Thnx my script works great now Quote Link to comment https://forums.phpfreaks.com/topic/170957-solved-multiple-textareas-into-one-mysql-prep-splitted-by-an-enter/#findComment-901709 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.