maliary Posted May 30, 2007 Share Posted May 30, 2007 Hi, I have this code that retrives a string from a database. The String is retrieved correctly, however the string is made of parameter names and their values concatenated together with characters as the separators. I am trying to separete the two and display them correctly along side other data in the table but with little success. $dbtable = 'test_findings'; $depts = $db->Execute("SELECT * FROM $dbtable WHERE batch_nr='87'"); while($row= $depts->FetchRow()){ $h = $row['serial_value']; -- This is the string $keywords = preg_split ("/[\=,\&]+/", "$h"); -------[color=blue] I remove the characters here [/color] foreach ($keywords as $value) { <tr><td class=va12_n><font color=#000000>'.$value.' <t /></td> } <td valign=top> '.$row['ranges'].' </td>'; ---- [color=blue]other data from the table[/color] <td valign=top> '.$row['msr_unit'].' </td> </tr> I would like to display it thus, in four diffrent columns? parameter range msr_unit value How can I out put the parameter name and value, and display it as above? Quote Link to comment https://forums.phpfreaks.com/topic/53585-mind-boggling-array/ Share on other sites More sharing options...
chigley Posted May 30, 2007 Share Posted May 30, 2007 What format are the strings in which you take from the database? Quote Link to comment https://forums.phpfreaks.com/topic/53585-mind-boggling-array/#findComment-264847 Share on other sites More sharing options...
maliary Posted May 30, 2007 Author Share Posted May 30, 2007 the format is - varchar Quote Link to comment https://forums.phpfreaks.com/topic/53585-mind-boggling-array/#findComment-264954 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.