$DEFAULT[engine]='mysql'; $DEFAULT[host]='localhost'; $DEFAULT[database]='umcahrco_umcauniv_elearning'; $DEFAULT[user]='umcahrco_umcauni'; $DEFAULT[password]='umca123'; ?> function select_where($FieldName,$TableName,$Where) { $sql = "select ".$FieldName." from ".$TableName." Where ".$Where; $result = mysql_query($sql); return $result; } function select_once($FieldName,$TableName,$Where) { $sql = "select ".$FieldName." from ".$TableName." Where ".$Where; $result = mysql_query($sql); $row = mysql_fetch_array($result); return $row; } function select_table($FieldName,$TableName) { $sql = "select ".$FieldName." from ".$TableName; $result = mysql_query($sql); return $result; } function select_count($TableName) { echo $sql ="select count(*) from ".$TableName; $result = mysql_query($sql); $row = mysql_fetch_row($result); return $row[0]; } function update($TableName,$Set,$Where) { $sql = "update ".$TableName." set ".$Set." where ".$Where; //echo $sql; mysql_query($sql); } function hexstr($hexstr) { $hexstr = str_replace(' ', '', $hexstr); $retstr = pack('H*', $hexstr); return $retstr; } function strhex($string) { $hexstr = unpack('H*', $string); return array_shift($hexstr); } //Page wise function function pagewise($numrows,$limit,$currenthit,$offset,$lnkScr,$lnkParam="") { global $action,$cr,$lnkscr; $pages=intval($numrows/$limit); if ($numrows % $limit) { $pages++; } print "
| Page: ";
if ($offset == 1) { $currenthit = $offset; }
else { $currenthit = $offset + 1; }
if (($numrows - $currenthit) >= $limit ) { $lasthit = $currenthit + ($limit - 1); }
else { $lasthit = $numrows; }
$selectedPg = sprintf("%.0f", (($currenthit/$limit) + 1));
$j= 1;
for ($i=1; $i<=$pages; $i++)
{
$newoffset = $limit * ($i - 1);
if($selectedPg == $i) { print "$i | "; }
else { print "$i |"; }
$j++;
if ($j == 30)
{
echo " "; $j = 1; } } echo " | "; if($offset!=0) { $cr=$offset-$limit; echo "Previous"; if ($offset+($offset) >= $numrows) { echo " "; } else { echo " | "; } } if($offset<$numrows && (($numrows-$offset)>$limit)) { echo "Next"; } print " |
| Page: ";
if ($offset == 1) { $currenthit = $offset; }
else { $currenthit = $offset + 1; }
if (($numrows - $currenthit) >= $limit ) { $lasthit = $currenthit + ($limit - 1); }
else { $lasthit = $numrows; }
$selectedPg = sprintf("%.0f", (($currenthit/$limit) + 1));
$j= 1;
for ($i=1; $i<=$pages; $i++)
{
$newoffset = $limit * ($i - 1);
if($selectedPg == $i) { $str.= "$i | "; }
else { $str.= "$i |"; }
$j++;
if ($j == 30)
{
$str.= " "; $j = 1; } } $str.= " | "; if($offset!=0) { $cr=$offset-$limit; $str.="Previous"; if ($offset+($offset) >= $numrows) { $str.= " "; } else { $str.= " | "; } } if($offset<$numrows && (($numrows-$offset)>$limit)) { $str.= "Next"; } $str.= " |
";
print_r($row1);
$path = BANNER_PATH;
if(substr($row1['bannerImage'],0,7)!="http://")
{
$strBanner_VirtualPath = "admin/banners/";
$strBannerHTML = "
";
}
else
{
$strBannerHTML = "
";
}
// echo htmlentities($strBannerHTML);
echo $strBannerHTML;
$sql2 = "UPDATE tbl_banners SET fld_bannerImpressions = fld_bannerImpressions + 1 WHERE fld_id = ".$row1['bannerId'];
$res2 = mysql_query($sql2);
}
}
?>Database error: pconnect(localhost, , $Password) failed.
MySQL Error: ()
Session halted.