need help in code of php
Posted: Wed Mar 12, 2003 12:24 pm
the error
the code is
the line is
Code: Select all
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/virtual/site13/fst/var/www/html/new/gets.php on line 28
Fatal error: Call to undefined function: build_table() in /home/virtual/site13/fst/var/www/html/new/gets.php on line 18Code: Select all
<?php
define('ha' , true);
$root = './';
include ($root .'comm.inc');
function sets($menu) {
switch ($menu) {
case "main":
include($root . 'includes/dbs.php' );
error_reporting ( E_ERROR | E_WARNING | E_NOTCIE );
$lk = mysql_connect($serv,$user,$pass) or die ("unable to do connection \n" .mysql_error());
mysql_select_db($dbname[0],$lk);
$qur = "select * from linkssets where loc = 'main' order by id desc";
$res = mysql_query($qur) or die ("error in the select " .mysql_error());
while ($row = mysql_fetch_assoc($res)) {
$out = array ( $row['desc'] => $row['name'] );
$id = array ( $row['id'] );
}
build_table($out, $id);
return $msg;
close_db($lk,$res);
}
}
function build_table( $data , $id) {
foreach ($data as $desc => $menu) {
foreach ($id as $kay => $val) {
$msg = "<tr><td width='47%' style='border-style: double; border-width: 3' height='18'>";
$msg .= "<A href='index.php?id=" .$id[$kay] . "'><b>" .$menu ."</b></a></td>";
$msg .= "<td width='53%' style='border-style: double; border-width: 3' height='18'>" .$desc "</td></tr>";
return $msg;
}
}
}
function close_db($lk,$re) {
mysql_free_result($re);
mysql_close($lk);
}
?>Code: Select all
$msg .= "<td width='53%' style='border-style: double; border-width: 3' height='18'>" .$desc "</td></tr>"; # line 28Code: Select all
build_table($out, $id); #line 18