sayedsohail Posted January 26, 2007 Share Posted January 26, 2007 Hi,I am having a small problem somewhere in my script, as the output of my php produce an excel sheet but all the columns is having a < d> tag. I don't know here i went wrong. Please help.Here is my script:[code]<?php$recNum = $_GET['rec_No']; $select = "SELECT * FROM clients where id=$recNum"; $export = mysql_query($select); $fields = mysql_num_fields($export); $header = "<table border=1><tr>";for ($i = 0; $i < $fields; $i++) { $header .= "<td>".mysql_field_name($export, $i) . "<\td>"; } $header .= "</tr>";while($row = mysql_fetch_row($export)) { $line = "<tr>"; foreach($row as $value) { if ((!isset($value)) OR ($value == "")) { $value = "<td> </td>"; } else { $value = str_replace('"', '""', $value); $value = "<td>" . $value . "<\td>";} $line .= $value; } $data .= trim($line)."</tr>"; }[/code] Quote Link to comment Share on other sites More sharing options...
linuxdream Posted January 26, 2007 Share Posted January 26, 2007 Looks like you are using "\" instead of "/" to end your HTML tags. Probably getting turned into a tab (\t) somewhere along the line which would make all <\td>'s look like < d>. Quote Link to comment Share on other sites More sharing options...
sayedsohail Posted January 26, 2007 Author Share Posted January 26, 2007 million thanks for your help. you made my day. thanks. Quote Link to comment 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.