nita Posted January 14, 2012 Share Posted January 14, 2012 Hi I have a problem with parsing a query into the email message. Where messege shuld be a complete resoult of a query. Please take a look on code below: $message = "\r\n" . 'Order details:' . '<br><br><table><tr><td>Name</td><td>Amount</td><td>Unit</td><td>Price</td><td>Total</td></tr>' . "\r\n"; /// till here is fine $result2 = mysql_query("SELECT * FROM orderslist WHERE supplier='$supplier'") or die(mysql_error()); $data = array(); $data['' . $row2['id']] = $_POST['' . $row2['id']]; $value = $_POST['' . $row2['id']]; while($row2=mysql_fetch_array($result2)) { $value = $_POST['' . $row2['id']]; if ( $value == ""){ } else { $total = $value * $row2['price']; /// this part below i have a problem with do not now how to join this part with the top part ($message) echo " <tr> <td class='H4'><strong>$row2[name]</strong></td> <td class='H4' align='center'>$value</td> <td class='H4'>$row2[unit]</td> <td class='H4'>$row2[price]</td> <td class='H4'>$total</td></tr>"; } } echo "</table>"; I think that has something to do with "\r\n" and dots, but i do not get that fully. If someone could help me on this one will be gratefull. Thank you very much in advance. Link to comment https://forums.phpfreaks.com/topic/254997-parse-query-results-into-the-email-message/ Share on other sites More sharing options...
gizmola Posted January 14, 2012 Share Posted January 14, 2012 You have a variable: $message = " some stuff and more and more"; Now you want to add more to the string, you can do ... $message = $message . "more things added to message"; or you can do: $message = "$message more things added to message"; or, what most people do, which is a shorthand for the first concatenation: $message .= "More things added to message"; Link to comment https://forums.phpfreaks.com/topic/254997-parse-query-results-into-the-email-message/#findComment-1307508 Share on other sites More sharing options...
nita Posted January 14, 2012 Author Share Posted January 14, 2012 I got it right. Thank you gizmola for clearing up this issue for me. Link to comment https://forums.phpfreaks.com/topic/254997-parse-query-results-into-the-email-message/#findComment-1307511 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.