PHP - Insert Different Lines From <textarea> To Different Mysql Rows
Hello, is it possible to insert somehow information from textarea to mysql?
For example i have 3 lines in text area: John Tacker is a bad guy Tom Tacker has a big nose Ted Tacker is the same person as John Tacker and i want to insert them in table's different rows Similar TutorialsGood morning to all. Recently I just read a post here , it's about how to insert different lines from <textarea> to different mysql rows . http://www.phpfreaks.com/forums/index.php?topic=325239.0 Thanks to AbraCadaver , his code works well. Quote $lines = array_map('mysql_real_escape_string', explode("\n", $_POST['textarea'])); $values = "VALUES ('" . implode("'), ('", $lines) . "')"; $query = "INSERT INTO table_name (column_name) $values"; But now if have more than one textarea , such as area1,area2 and area3 , how should change the code so that all data can be inserted into database simultaneously? Such as data of area1 is for column 1, row 1, data for area2 is for column2 , row 1, and data of area3 is for column 3 ,row 1. Is it possible to make this works? Thanks for every reply . Hi Guys, I have a textarea on a html page with XXX amount of lines. How can I in php insert a separate mysqlrow for EACH line on the html textarea? Thanks G i have created my own code of custom shopping cart
i have viewcart.php working great, now when i want to insert the orders from viewcart.php with list of like 5 items, how can i insert 5 names of products into my database 1 row
example
names are
1. jean
2. mond
3. richard
4. gwen
list above is the results of my while loop, now i want to insert those names to my database column[order_productname] so that i can identity what products are paid by my clients.
i tried fetch_array but if i assign variable to fetch array result, it only shows 1 which is "jean"
i wish this is possible
dforth
Hi again all, Why does the foreach loop im doing, put the array values from collection, into seperate table rows rather than 1 row per whole array? <?php class registration{ public $fields = array("username", "email", "password"); public $data = array(); public $table = "users"; public $dateTime = ""; public $datePos = 0; public $dateEntryName = "date"; public $connection; function timeStamp(){ return($this->dateTime = date("Y-m-d H:i:s")); } function insertRow($collection){ //HERE foreach($this->fields as $row => $value){ mysql_query("INSERT INTO $this->table ($value) VALUES ('$collection[$row]')"); } mysql_close($this->connection->connectData); } function validateFields(){ $this->connection = new connection(); $this->connection->connect(); foreach($this->fields as $key => $value){ array_push($this->data, $_POST[$this->fields[$key]]); } $this->dateTime = $this->timeStamp(); array_unshift($this->data, $this->dateTime); array_unshift($this->fields, $this->dateEntryName); foreach($this->data as $value){ echo "$value"; } $this->insertRow($this->data); } } $registration = new registration(); $registration->validateFields(); ?> I end up with 3 rows row 1: username row 2: email row 3 : password rather than row 1:username email password. Ok I'm trying to insert multiple rows by using a while loop but having problems. At the same time, need to open a new mysql connection while running the insert query, close it then open the previous mysql connection. I managed to insert multiple queries before using a loop, but for this time, the loop does not work? I think it is because I am opening another connection... yh that would make sense actually? Here is the code: $users = safe_query("SELECT * FROM ".PREFIX."user"); while($dp=mysql_fetch_array($users)) { $username = $dp['username']; $nickname = $dp['nickname']; $pwd1 = $dp['password']; $mail = $dp['email']; $ip_add = $dp['ip']; $wsID = $dp['userID']; $registerdate = $dp['registerdate']; $birthday = $dp['birthday']; $avatar = $dp['avatar']; $icq = $dp['icq']; $hp = $dp['homepage']; echo $username." = 1 username only? :("; // ----- Forum Bridge user insert ----- $result = safe_query("SELECT * FROM `".PREFIX."forum`"); $ds=mysql_fetch_array($result); $forum_prefix = $ds['prefix']; define(PREFIX_FORUM, $forum_prefix); define(FORUMREG_DEBUG, 0); $con = mysql_connect($ds['host'], $ds['user'], $ds['password']) or system_error('ERROR: Can not connect to MySQL-Server'); $condb = mysql_select_db($ds['db'], $con) or system_error('ERROR: Can not connect to database "'.$ds['db'].'"'); include('../_phpbb_func.php'); $phpbbpass = phpbb_hash($pwd1); $phpbbmailhash = phpbb_email_hash($mail); $phpbbsalt = unique_id(); safe_query("INSERT INTO `".PREFIX_FORUM."users` (`username`, `username_clean`, `user_password`, `user_pass_convert`, `user_email`, `user_email_hash`, `group_id`, `user_type`, `user_regdate`, `user_passchg`, `user_lastvisit`, `user_lastmark`, `user_new`, `user_options`, `user_form_salt`, `user_ip`, `wsID`, `user_birthday`, `user_avatar`, `user_icq`, `user_website`) VALUES ('$username', '$username', '$phpbbpass', '0', '$mail', '$phpbbmailhash', '2', '0', '$registerdate', '$registerdate', '$registerdate', '$registerdate', '1', '230271', '$phpbbsalt', '$ip_add', '$wsID', '$birthday', '$avatar', '$icq', '$hp')"); if (FORUMREG_DEBUG == '1') { echo "<p><b>-- DEBUG -- : User added: ".mysql_affected_rows($con)."<br />"; echo "<br />-- DEBUG -- : Query used: ".end($_mysql_querys)."</b></p><br />"; $result = safe_query("SELECT user_id from ".PREFIX_FORUM."users WHERE username = '$username'"); $phpbbid = mysql_fetch_row($result); safe_query("INSERT INTO `".PREFIX_FORUM."user_group` (`group_id`, `user_id`, `group_leader`, `user_pending`) VALUES ('2', '$phpbbid[0]', '0', '0')"); safe_query("INSERT INTO `".PREFIX_FORUM."user_group` (`group_id`, `user_id`, `group_leader`, `user_pending`) VALUES ('7', '$phpbbid[0]', '0', '0')"); mysql_close($con); } include('../_mysql.php'); mysql_connect($host, $user, $pwd) or system_error('ERROR: Can not connect to MySQL-Server'); mysql_select_db($db) or system_error('ERROR: Can not connect to database "'.$db.'"'); } So I need to be able to insert these rows using the while loop.. how can I do this? I really appreciate any help. I have a form that is processed using PHP (post method) and there is a textarea people will enter text into. After processing, the text is displayed to the user. However, if the user did a Carriage Return (i.e. hit Enter) when they originally entered the text, that text does NOT show on a new line when displayed later. For example, if they type this into the text area... "Hello there (they hit Enter here) How are you (they hit Enter here) Good I hope" It will display like this, all on one line: "Hello there How are you Good I hope" In other words, it doesn't seem to remember that Enter was hit. Is there some way to "preserve" the fact that someone hit the "Enter" key, so that when text is displayed later, it will show the text on a new line if the user in fact hit "Enter" when originally typing it. I am probably not using the right terms in the right spots (i.e. newline, carriage return, enter, etc) but I think you get the picture Let me know if anyone knows how to do this. Thanks! Hi all, Hopefully this will be a very easy question for one of you! Basically, I've created a little invoice script, and I need some help with the invoice data (i.e the item info, qty and the price). My question is how do i deal with the data from multiple rows containing 3 text fields each (item, qty and price). I've been playing with a foreach loop, which I can make echo info in the item field for each row. How do I incorporate the other fields (the qty and price)? Can I build an array to hold it all? Thanks for any help! Jim Thanks ahead of time, I have been working this all week end but get lost.... a. I want to insert all the lines from file1.txt into file2.txt . b. I want the all lines in file1.txt to be inserted in file2.txt starting at "<image>" tag label in file2.txt. c. I would like to overwrite all lines that start with the "<image>" tag in file2.txt with the insert (text in file1.txt contains <image> tag also). file2.txt has lines above and below the insert point <image>. The insert text (file1.txt) could be as many as twenty lines (records) all/each beginning with the<image>tag. Here is what I have done so far. <? $key = '<image>'; //a text tag in $file1 and $file2 //copy file $file = "file1.txt"; $file2= 'file2.txt"; $newfile = "filetemp.txt"; copy($file, $newfile) or exit("could not copy $file"); //load file array $fc = fopen ($file, "r"); while (!feof ($fc)) { $buffer = fgets($fc, 4096); $lines[] = $buffer; } fclose ($fc); //open same file and use "w" to clear file ,not sure this is needed $f=fopen($newfile,"w") or die("$file did not open"); /* uncomment to debug print_r($lines); print "<br>\n"; */ //loop through array 'foreach foreach($lines as $line) { fwrite($f,$line); //rewrite $line in file if (strstr($line,$key)){ //find $key in each line fwrite($f,$newline."\n"); } //rewrite $line in file } fclose($f); copy($newfile, $file2) or exit("could not copy $newfile"); ?> Again thanks ahead of time, I just keep losing the flow, old I guess. Tom Hello, Experts! Need you advice. Here is the code: <?php if ($var == "") { echo "text"; } if ($var == "*") { echo "text"; } else if ($var != "") { $query = "SELECT * FROM bd WHERE ....."; $data = mysql_query($query) or die(mysql_error()); $anymatches=mysql_num_rows($data); if ($anymatches != 0) { echo "text"; while($row = mysql_fetch_array($data)) { echo "text"; } } if ($anymatches == 0) { $query2 = "SELECT * FROM bd WHERE....."; $data2 = mysql_query($query2) or die(mysql_error()); $anymatches2=mysql_num_rows($data2); if ($anymatches2 != 0) { echo "text" else { mysql_query("INSERT INTO notfound (notfound) VALUES ('$var')") or die(mysql_error()); } } } ?> The last line adds two identical lines to my table. Do I run it twice? Thanks in advance! The code below kind of works, I don't get any errors. It has 2 problems; it only inserts the second row of data I get nothing for the first row. It also does not insert the 4id correctly I just get 1 instead of the actually user id number. I'd appreciate some help, been trying to hack this out for a couple hours. Code: [Select] <?php // Begin the script for this page $id = $_SESSION['id']; if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form } else { //Assign each array to a variable $id = $_SESSION['id']; $store = $_POST['store']; $item = $_POST['item']; $itemprice = $_POST['itemprice']; $itemnumber = $_POST['itemnumber']; $couponvalue = $_POST['couponvalue']; $limit = count($id); for($i=0;$i<$limit;$i++){ $id[$i] = $id[$i]; $store[$i] = check_input($store[$i]); $item[$i] = check_input($item[$i]); $itemprice[$i] = check_input($itemprice[$i]); $itemnumber[$i] = check_input($itemnumber[$i]); $couponvalue[$i] = check_input($couponvalue[$i]); } $query = "INSERT INTO `item` (user_id, store, item, itemprice, itemnumber, couponvalue) VALUES ('".$id[$i]."','".$store[$i]."', '".$item[$i]."', '".$itemprice[$i]."', '".$itemnumber[$i]."', '".$couponvalue[$i]."')"; if (!mysql_query($query,$link)){ die('Error: ' . mysql_error()); } else { echo "$row record added"; } } ?> <div class="pageContent"> <div id="main"> <div class="container"> <form action="" method="post"> <table> <tr> <input type="text" name="id[]" id="id[]" value="<?php echo $_SESSION['id'];?>" /> <td><DIV CLASS="p2"><center><b>Store</b></center></div> <input type="text" name="store[]" id="store[]" size="15" maxlength="255"/></td> <td><DIV CLASS="p2"><center><b>Item</b></center></div> <input type="text" name="item[]" id="item[]" size="15" maxlength="255"/></td> <td><DIV CLASS="p2"><center><b>Item Price</b></center></div> <input type="text" name="itemprice[]" id="itemprice[]" size="15" maxlength="255"/></td> <td><DIV CLASS="p2"><center><b>Item Number</b></center></div> <input type="text" name="itemnumber[]" id="itemnumber[]" size="15" maxlength="255"/></td> <td><DIV CLASS="p2"><center><b>Coupon Value</b></center></div> <input type="text" name="couponvalue[]" id="couponvalue[]" size="15" maxlength="255"/></td> </tr> <tr> <input type="text" name="id[]" id="id[]" value="<?php echo $_SESSION['id'];?>" /> <td><input type="text" name="store[]" id="store[]" size="15" maxlength="255"/></td> <td><input type="text" name="item[]" id="item[]" size="15" maxlength="255"/></td> <td><input type="text" name="itemprice[]" id="itemprice[]" size="15" maxlength="255"/></td> <td><input type="text" name="itemnumber[]" id="itemnumber[]" size="15" maxlength="255"/></td> <td><input type="text" name="couponvalue[]" id="couponvalue[]" size="15" maxlength="255"/></td> </tr> </table> <input type="submit" name="submit" value="Submit Item"> </form> </div> </div> </div> Hi all!!! I could really use some help. I'm burning my brain out trying to figure out the easiest way to go about this. Here is what I am trying to do (in a nutshell) so I could really use full coding examples. I need to create a text area with simple formatting tools such as Bold, Italics, Underline, Bullets, and Numbering. After formatting the text with only those available formatting tools, everything in the text area needs to be converted into html tags. After the conversion, the HTML data that is create is submitted into a single field into a SQL database. Any help will be greatly appreciated!!! The information is drawn in from a table into a form that the user will click submit and all the rows will be inputted into the table with their username association. With this form, its only inputting the last row and not all of them. You're help is much appreciated! Here is the form in the PHP area: while($row=mysql_fetch_array($get_items_sql)){ $name =$row['item']; $date = ($row['expiration_date']); $exp_date = date('M d Y', strtotime($row['expiration_date'])); $content .= ""; $content .="<table width=\"450\" border=\"0\"><tr><td width=\"200\"><span class=\"anotherfont\"><input name=\"item[]\" type=\"hidden\" value=\"$name\" id=\"item[]\">$name</span></td><td width=\"200\"><span class=\"greenfont\"><input name=\"expiration_date[]\" type=\"hidden\" value=\"$date\" id=\"expiration_date[]\">$exp_date</span><input name=\"username[]\" type=\"hidden\" value=\"$username\" id=\"username[]\"/> </td></tr><br /></table>"; $content .= "\n"; } $content .= "</ul>\n"; Then below is part of the HTML Form with $content referenced: <form action="add_select.php?source_id=<?php echo $coupon_source ?>" method="post" enctype="multipart/form-data" name="add_new" id="add_new"> <?php echo $content ?> <input name="SUBMIT" type="submit" value="submit" /></form><br /> Then here is the section from the "add_select.php" file from the form: include('connect.php'); foreach($_POST['item'] as $row=>$item) { $Item_name=$item; $expiration_date=$_POST['expiration_date'][$row]; $username=$_POST['username'][$row]; } foreach($_POST['item'] as $row=>$item) { $Item_name=mysql_real_escape_string($item); $expiration_date=mysql_real_escape_string($_POST['expiration_date'][$row]); $username=mysql_real_escape_string($_POST['username'][$row]); } $sql2="INSERT INTO place (item, expiration_date, username) VALUES ('$Item_name', '$expiration_date', '$username')"; if (!mysql_query($sql2)) { die('Error: ' . mysql_error()); }else { header("location:insert_complete.php"); } Hi coders,
i have a js to add multiple input and its depend to a user how many input should he want to add. and my problem is, it work insert data in a first line of rows but the rest of rows are not save.
any idea, what should i add to make it work.
js
<script> $(document).ready(function(){ $('#add').click(function(){ var inp = $('#box'); var i = $('input').size() + 1; $('<div id="box' + i +'"><input type="text" id="name" class="name" name="code[]' + i +'" placeholder="Input '+i+'"/><img src="remove.png" width="32" height="32" border="0" align="top" class="add" id="remove" /> </div>').appendTo(inp); i++; }); $('body').on('click','#remove',function(){ $(this).parent('div').remove(); }); }); </script>html <div id="box"> <input name = "code[]" type="text" id="name" class="name" placeholder="Input 1"> <img src="add.png" width="32" height="32" border="0" align="top" class="add" id="add" /> </div>php $rf = $_POST['regform']; $b = $_POST['branch']; $d = $_POST['date']; $c = $_POST['code']; $u = $_POST['user']; for($i = 0; $i<count($c); $i++) { $a_query = mysql_query("INSERT INTO code_number(ts_number,branch_id,yy,code,username) VALUES('$rf','$b','$d','$c[$i]','$u')"); } return $a_query; Hi all, I am managing a social network and am creating a script to allow the admin to private message all users on the site. Even setting the max execution time to unlimited within the file does not allow us to insert all 40,000 rows into the 'message' table, it stops after several thousand rows. Our hosts tell us setting this globally is a bad idea/unstable. Does anyone have some advice on the best to do this? No email notifications need to be sent so it is purely allowing the script to run it's full course without stopping. I did consider a cron job but without emails doing in 'batches' seems a bit unecessary so I'm clearly missing something. ANy and all advice would be most welcome! Richard So when I execute this it'll go for about 130k rows then give a 500 error. Any ideas how to avoid this and get it to complete? Code: [Select] $i=10000000; while($i<=99999999) { $public = $i; $value = rand(10000000, 99999999); mysql_query("INSERT INTO yummy_table (public, value) VALUES('$public', '$value' ) ") or die(mysql_error()); $i++; } echo "done";
Hi, I have an app that access a MySQL database via a php script. For some reason when it is an SQL INSERT it returns -11 but as I said the INSERTS executes successfully. The app requesting the service sends in sequence: char* txtSQL[]={"INSERT INTO activity (mac,jd,date,time,area,type,value) VALUES ('a9c4952de6b4',2458454,'2018-12-01','10:22','Area0002','h',130)", "INSERT INTO activity (mac,jd,date,time,area,type,value) VALUES ('a9c4952de6b4',2458454,'2018-12-01','10:22','Area0002','h',130)", "INSERT INTO activity (mac,jd,date,time,area,type,value) VALUES ('a9c4952de6b4',2458454,'2018-12-01','10:22','Area0002','h',130)", "INSERT INTO activity (mac,jd,date,time,area,type,value) VALUES ('a9c4952de6b4',2458454,'2018-12-01','10:22','Area0002','h',130)", "UPDATE activity set value=333 where value=130", "SELECT sum(value) from activity where mac='a9c4952de6b4'", "DELETE from activity WHERE value=333"}; I set a monitor to check what was being returned and got: query=INSERT INTO activity (mac,jd,date,time,area,type,value) VALUES ('a9c4952de6b4',2458454,'2018-12-01','10:22','Area0002','h',130) HttpResponse: - httpResponseCode: -11 query=INSERT INTO activity (mac,jd,date,time,area,type,value) VALUES ('a9c4952de6b4',2458454,'2018-12-01','10:22','Area0002','h',130) HttpResponse: - httpResponseCode: -11 query=INSERT INTO activity (mac,jd,date,time,area,type,value) VALUES ('a9c4952de6b4',2458454,'2018-12-01','10:22','Area0002','h',130) HttpResponse: - httpResponseCode: -11 query=INSERT INTO activity (mac,jd,date,time,area,type,value) VALUES ('a9c4952de6b4',2458454,'2018-12-01','10:22','Area0002','h',130) HttpResponse: - httpResponseCode: -11 query=UPDATE activity set value=333 where value=130 HttpResponse: 4 * httpResponseCode: 201 -------------------------------------->As can be seem the INSERTS above returned error but worked OK query=SELECT sum(value) from activity where mac='a9c4952de6b4' HttpResponse: 1379 * httpResponseCode: 200 query=DELETE from activity WHERE value=333 HttpResponse: 4 * httpResponseCode: 201 The PHP script do ing the job i s as be low : <?php include('connection.php'); //these are just in case setting headers forcing it to always expire header('Cache-Control: no-cache, must-revalidate'); error_log(print_r($_POST,TRUE)); if( isset($_POST['query']) && isset($_POST['key']) ){ //checks if the tag post is there and if its been a proper form post header('Content-type: application/x-www-form-urlencoded'); if($_POST['key']==$SQLKEY){ //validates the SQL key $query=urldecode($_POST['query']); if(get_magic_quotes_gpc()){ //check if the worthless pile of crap magic quotes is enabled and if it is, strip the slashes from the query $query=stripslashes($query); } $conn = new mysqli($DB_ADDRESS,$DB_USER,$DB_PASS,$DB_NAME); //connect if($conn->connect_error){ //checks connection header("HTTP/1.0 400 Bad Request"); echo "ERROR Database Connection Failed: " . $conn->connect_error, E_USER_ERROR; //reports a DB connection failure } else { $result=$conn->query($query); //runs the posted query if($result === false){ header("HTTP/1.0 400 Bad Request"); //sends back a bad request error echo "Wrong SQL: " . $query . " Error: " . $conn->error, E_USER_ERROR; //errors if the query is bad and spits the error back to the client } else { if (strlen(stristr($query,"SELECT"))>0) { //tests if it's a SELECT statement $csv = ''; // bug fix Undefined variable: csv while ($fieldinfo = $result->fetch_field()) { $csv .= $fieldinfo->name.","; } $csv = rtrim($csv, ",")."\n"; //******************************** echo $csv; //prints header row $csv = ''; $result->data_seek(0); while($row = $result->fetch_assoc()){ foreach ($row as $key => $value) { $csv .= $value.","; } $csv = rtrim($csv, ","); //."\n"; } echo $csv; //prints all data rows } else { header("HTTP/1.0 201 Rows"); echo $conn->affected_rows; //if the query is anything but a SELECT, it will return the number of affected rows (INSERT IS RETURNING -11) } } $conn->close(); //closes the DB } } else { header("HTTP/1.0 400 Bad Request"); echo "-Bad Request"; //reports if the secret key was bad } } else { header("HTTP/1.0 400 Bad Request"); echo "*Bad Request"; } ?>
Any help will be much appreciated. Paulo Borges Can anyone tell me why this is not INSERTing? My array data is coming out just fine.. I've tried everything I can think of and cannot get anything to insert.. Ahhhh! <?php $query = "SELECT RegionID, City FROM geo_cities WHERE RegionID='135'"; $results = mysqli_query($cxn, $query); $row_cnt = mysqli_num_rows($results); echo $row_cnt . " Total Records in Query.<br /><br />"; if (mysqli_num_rows($results)) { while ($row = mysqli_fetch_array($results)) { $insert_city_query = "INSERT INTO all_illinois SET state_id=$row[RegionID], city_name=$row[City] WHERE id = null" or mysqli_error(); $insert = mysqli_query($cxn, $insert_city_query); if (!$insert) { echo "INSERT is NOT working!"; exit(); } echo $row['City'] . "<br />"; echo "<pre>"; echo print_r($row); echo "</pre>"; } //while ($rows = mysqli_fetch_array($results)) } //if (mysqli_num_rows($results)) else { echo "No results to get!"; } ?> Here is my all_illinois INSERT table structu CREATE TABLE IF NOT EXISTS `all_illinois` ( `state_id` varchar(255) NOT NULL, `city_name` varchar(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Here is my source table geo_cities structu CREATE TABLE IF NOT EXISTS `1` ( `CityId` varchar(255) NOT NULL, `CountryID` varchar(255) NOT NULL, `RegionID` varchar(255) NOT NULL, `City` varchar(255) NOT NULL, `Latitude` varchar(255) NOT NULL, `Longitude` varchar(255) NOT NULL, `TimeZone` varchar(255) NOT NULL, `DmaId` varchar(255) NOT NULL, `Code` varchar(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Hello everybody!
I am trying to figure out how to obtain all the data related to a key, but I've got no results so far and I am becoming really frustated, let's see if any of you could help me out with this.
Imagine I have a table with several columns, but we bother about two of them, let's say we have serial numbers of some product, on the left Incoming serial number (we can repair or swap the unit), on the right the outcoming serial number (same if we have repared the unit, different if we swap it for another unit).
Then we have, for example:
A -> A (Unit A enters and we repaired it)
A -> B (Same unit came another day for some reason and we couldn't repair it, so we swap it by giving B to the customer)
B -> C (Unluckily B was defective so we have to change it again)
C -> C (C had another problem and we repaired it)
We have that in the database from different days and the such, so now, we want to know the historical and we know "C". If we perform a SELECT * FROM... WHERE incoming/outcoming serial number = "C" we'll get:
B -> C
C -> C
So we should seek now for B and keep going... but I cannot proceed correctly, 'cause if I SELECT using B I'll get again B -> C (and A -> B, what I want), but when do I know I have to finish? How could I implement this as a function or whatever? showing every not repeated line from the beginning.
Could your minds help mine? Thank you very much in advance!.
Hello everyone. I'm creating a website that has a sort of messaging system built in and I'm trying to get the information pulled out of the database to display exactly as it was typed. For example, if someone types this message: "This is the first line. This is the second line. And this is two lines below the second line." (By the way, when I view this message using phpMyAdmin, the message is displayed in the above format.) I would like to have the message displayed the same way when it is queried from the database. As of now, this is what I'm seeing instead: "This is the first line. This is the second line. And this is two lines below the second line." How can I achieve this? I would post the code that I'm using, but it's just a basic mysql query to get a variable "$message" then I'm just using echo "$message"; to put it on the page. Any help to point me in the right direction would be greatly appreciated. Thanks! Hi there, I am building a custom configuration program, where i want people to choose various items, e.g. 1. Size of a table, colour, how many drawers, other features. I want to store all my options in mysql tables. At the end of the process I want to somehow get mysql to get line co-ordinates from a table and dynamically draw a plan view and elevation view of the table showing the options that the customer has chosen. I was wondering if anyone has ever been able to do this. I'm not sure how to start, or if php is capable of doing this. any ideas would be great. |