Hi I am using following code to display the table but it shows the error like this.
Warning: require(HTML/Table.php) [function.require]: failed to open stream: No such file or directory in /home/aspire/public_html/table.php on line 3
Fatal error: require() [function.require]: Failed opening required 'HTML/Table.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/aspire/public_html/table.php on line 3
This is my code. Can anyone tell me what mistake I did.
require("HTML/Table.php");
$tableStyle = array("bgcolor"=>"#FFFFFF", "border"=>"1", "width"=>"150", "cellpadding"=>"1", "cellspacing"=>"2");
$colA = array("field 1", "field 2", "field 3", "", "<b>TOTAL</b>");
$a = 10;
$b = 15;
$c = 8;
$total = $a+$b+$c;
$colB = array($a, $b, $c, "", "<b>".$total."</b>");
$table = new HTML_Table($tableStyle);
$table->addCol($colA);
$table->addCol($colB);
$table->display();
Using this "php go-pear.phar" command I found the following path.
Current include path : .:/usr/share/php:/usr/share/pear
Configured directory : /home/aspire/pear/share/pear
Currently used php.ini (guess) : /etc/php5/cli/php.ini
So when specify the path before start my code like
include_path=".:/usr/share/php:/usr/share/pear/";
it shows the error like
Parse error: syntax error, unexpected '=' in /home/aspire/public_html/table.php on line 2
How to solve this problem.