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] Link to comment https://forums.phpfreaks.com/topic/35881-solved-php-excel-output-problem/ 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>. Link to comment https://forums.phpfreaks.com/topic/35881-solved-php-excel-output-problem/#findComment-170160 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. Link to comment https://forums.phpfreaks.com/topic/35881-solved-php-excel-output-problem/#findComment-170180 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.