开发者

writing values from database to rtf file

i am fetching some data from MySql database and i want to write it to rtf file,everything is working fine means rtf generation,and the values from database are also correct but when i open up rtf file it shows no data.below is the code snippet i am using.

**$rtf = new Rtf ();

 // Headear of rtf

 $head = &$rtf->addHeader ();

 $the开发者_开发问答ad = &$head->addTable ();

 $thead->addRows (1);

 $thead->addColumnsList(array (5.5, 9.5));

 $thead->writeToCell (1, 2, "<b>hello</b>" $fontHeader, $paraR);**

This code is working fine,but instead of hello there shuld be a field that is coming from database,like

$stmt="select name from xyz";
$result = mysql_query ( $stmt);

while ($rslt = fetch_array($result))
{
   $rslt['name'] = $rslt['name'];
}

now if i do like $thead->writeToCell (1, 2, "".$rslt['name']." $fontHeader, $paraR); it dont show any result.plz guid me. Thanks in advance!!


Remember: Strings are joined by '.'

try $thead->writeToCell (1, 2, $rslt['name'].$fontHeader, $paraR);

also, $rslt['name'] = $rslt['name']; doesn't make any sense. Replace it with the code above.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜