PDA

View Full Version : mysql error



vividona
11-16-2008, 04:47 PM
mysql_error
hi experts,

I programmed this small article script

I got this mysql error

http://bhl.43i.net/

but in my apache there is no error


Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/dothost.eu/vhosts/bhl.43i.net/index.php on line 69

BLiZZaRD
11-16-2008, 05:04 PM
wow. I don't even see how that mess can produce a visible page. the body tags, head halfway down the script, 4 closing html tags, opening a table (halfway) inside another table...

copy and paste job here?

If you clean up the code and write it correctly I am willing to bet your errors will disappear.

vividona
11-16-2008, 05:17 PM
<?PHP
# ------------------------------------------------------------------------------------------#
# BHLsimpleTool - PHP Content Management System #
# Copyright (c) 2008 bhl.org #
# <http://www.bhl.org/> #
# -----------------------------------------------------------------------------------------#
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
#-------------------------------------------------------------------------------------------#
# This program is distributed in the hope tat it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# -----------------------------------------------------------------------------------------#
require("BHL_DB.php");
class BHL_UserInfoInDet extends BHL_DB{

protected $UserId;
protected $UserFname;
protected $UserFamName;
protected $UserName;
protected $UserPswd;
protected $UserVerPswd;
protected $UserEmailAdd;
protected $UserIpAdd;
public $Date;
protected $Uregcode;
public $Host;
public $Self;
public $Smail;
public $StartSession;
public $URL;
public $REFERRER;
const BHL_DB_USER_TBL = 'userregdata';
const BHL_DB_VERIFICATION = 'verification';
const BHL_CONT_MGM = 'content';
const BHL_ADMINISTRATOR = 'adminitrator';
const BhlDbBannedUsersTbl = 'banned_users';
const BhlDbCommUsersTbl = 'comments';
const BhlCatsTbl = "categories";
const BhlSubcatsTbl = "subcategories";
const BhlPermitTbl = "BhlPermissions";
protected $ArtiSub;
protected $ArtiBod;
protected $ArtiComm;
public $ScptName;
public $ScptEm;
protected $Cats;
protected $CatsDesc;
protected $Subcats;
protected $SubcatsDesc;

public function __construct($UserId, $UserFname, $UserFamName, $UserName, $UserPswd, $UserVerPswd, $UserEmailAdd, $UserIpAdd,
$Date, $Uregcode, $Host, $Self, $Smail, $Time, $URL, $REFERRER, $StartSession, $ArtiSub, $ArtiBod,
$ArtiComm, $ScptName, $ScptEm, $Cats, $CatsDesc, $Subcats, $SubcatsDesc){
parent::__construct( );

$this->UserId = $UserId;
$this->UserFname = $UserFname;
$this->UserFamName = $UserFamName;
$this->UserName = $UserName;
$this->UserPswd = $UserPswd;
$this->UserVerPswd = $UserVerPswd;
$this->UserEmailAdd = $UserEmailAdd;
$this->UserIpAdd = $UserIpAdd;
$this->BhlCurDate($Date);
$this->MdfyUserRegCode( $Uregcode );
$this->Host = $Host;
$this->Self = $Self;
$this->setmail($Smail);
$this->setTime( $Time );
$this->setSessionSt($StartSession);
$this->URL = $URL;
$this->REFERRER = $REFERRER;
$this->ArtiSub = $ArtiSub;
$this->ArtiBod = $ArtiBod;
$this->ArtiComm = $ArtiComm;
$this->setScptName($ScptName);
$this->setScptEm($ScptEm);
$this->Cats = $Cats;
$this->CatsDesc = $CatsDesc;
$this->Subcats = $Subcats;
$this->SubcatsDesc = $SubcatsDesc;
}

public function SessionSt() {
return $this->StartSession;
}

public function setSessionSt($StartSession){
$this->StartSession = session_start();

}

public function getTime() {
return $Time;
}

public function setTime( $Time ){
$this->Time = time();
}

public function getHost(){
return $this->Host;
}

public function getSelf(){
return $this->Self;
}

public function setHost( $Host ){
$this->Host = $_SERVER['HTTP_HOST'];
}

public function setSelf( $Self ){
$this->Self = $_SERVER['PHP_SELF'];
}

public function getmail(){
return $this->Smail;
}

public function setmail($Smail){
$this->Smail = 1;
}

public function CurDate(){
return $this->Date;
}

public function BhlCurDate($Date){
$this->Date = gmdate('D, d M Y H:i:s');
}

public function getScptName(){
return $this->ScptName;
}

public function setScptName($ScptName){
$this->ScptName = "BHLsimpleTOOL";
}

public function getScptEm(){
return $this->ScptEm;
}

public function setScptEm($ScptEm){
$this->ScptEm = "mail@domain.com";
}

public function ClnArtiSub(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->ArtiSub ));
}
}

public function StripArtiSub() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->ArtiSub ));
}
}

public function ClnArtiBod(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->ArtiBod ));
}
}

public function StripArtiBod() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->ArtiBod ));
}
}

public function ClnCats(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->Cats ));
}
}

public function StripCats() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->Cats ));
}
}

public function ClnCatsDesc(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->CatsDesc ));
}
}

public function StripCatsDesc() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->CatsDesc ));
}
}

public function ClnSubcats(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->Subcats ));
}
}

public function StripSubcats() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->Subcats ));
}
}

public function ClnSubcatsDesc(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->SubcatsDesc ));
}
}

public function StripSubcatsDesc() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->SubcatsDesc ));
}
}

public function ClnArtiComm(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->ArtiComm ));
}
}

public function StripArtiComm() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->ArtiComm ));
}
}

public function CheckIpAdd() {
if (getenv('HTTP_CLIENT_IP')) {
$this->UserIpAdd = getenv('HTTP_CLIENT_IP');
}
elseif (getenv('HTTP_X_FORWARDED_FOR')) {
$this->UserIpAdd = getenv('HTTP_X_FORWARDED_FOR');
}
elseif (getenv('HTTP_X_FORWARDED')) {
$this->UserIpAdd = getenv('HTTP_X_FORWARDED');
}
elseif (getenv('HTTP_FORWARDED_FOR')) {
$this->UserIpAdd = getenv('HTTP_FORWARDED_FOR');
}
elseif (getenv('HTTP_FORWARDED')) {
$this->UserIpAdd = getenv('HTTP_FORWARDED');
}
else {
$this->UserIpAdd = $_SERVER['REMOTE_ADDR'];
}
return $this->UserIpAdd;
}

public function ClnUserRegCode(){
if( ! get_magic_quotes_gpc() ){
return addslashes( $this->Uregcode );
}
}

public function MdfyUserRegCode( $Uregcode ){
$chars = 'abcdefghijklmnopqrstuvwxyz1234567890';
$pp = '';
while (strlen($pp) < 8) {
$pp .= substr($chars, mt_rand() % (strlen($chars)), 1);
$this->Uregcode = sha1($pp);
}
}
public function ClnUserFname() {
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->UserFname ));
}
}

public function StripUserFname() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->UserFname ));
}
}

public function ClnUserFamName() {
if( ! get_magic_quotes_gpc() ) {
return addslashes(htmlspecialchars( $this->UserFamName ));
}
}

public function StripUserFamname() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->UserFamname ));
}
}

public function ClnUserName() {
if( ! get_magic_quotes_gpc() ) {
return addslashes(htmlspecialchars( $this->UserName ));
}
}

public function StripUserName() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->UserName ));
}
}

public function ClnUserPswd(){
if( ! get_magic_quotes_gpc() ) {
return addslashes(md5(htmlspecialchars( $this->UserPswd )));
}
}

public function StripUserPswd() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(md5(htmlspecialchars( $this->UserPswd )));
}
}

public function ClnUserVerPswd() {
if( ! get_magic_quotes_gpc() ) {
return addslashes(md5(htmlspecialchars($this->UserVerPswd )));
}
}

public function StripUserVerPswd() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(sha1(htmlspecialchars( $this->UserVerPswd )));
}
}

public function ClnUserEmAdd() {
if( ! get_magic_quotes_gpc() ) {
return addslashes(htmlspecialchars( $this->UserEmailAdd ));
}
}

public function StripUserEmAdd(){
if( ! get_magic_quotes_gpc() ) {
return stripslashes( $this->UserEmailAdd );
}
}
}


?>

vividona
11-16-2008, 05:32 PM
sorry sir
problem in attachments

plz check this link

http://www.4shared.com/file/71762977/1bf0b5a0/classes.html

BLiZZaRD
11-16-2008, 05:40 PM
okay, I will take a look.. but you still need to fix your page... THIS is the mess I was talking about:



<html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>BHLsimpleTool v1.0 - index page</title>
</head><table width="860" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#996600">
<tr>
<th ><table width="860" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#996600">
<tr>
<th ><table width="860px" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#996600" bgcolor="#000033"><tr><th
class="style1" scope="col"><div align="right"><table width="860" border="0" align="center" cellpadding="0" cellspacing="0"
bordercolor="#996600" bgcolor="#000033"><tr><th scope="col"><div align="right"><img src="Themes/default/images/logo.png" alt=""
width="358" height="70" border="0" align="right" usemap="#Map" /></div></th></tr></table><table width="860" border="0" align="center"
cellpadding="0" cellspacing="0" bgcolor="#000033"><tr><th scope="col"><div align="right">

<table width="860" border="1" cellpadding="0" cellspacing="0" bordercolor="#996600" bgcolor="#000033"><tr><th width="107"
scope="col"><div align="right"><a href="index.php"><img src="Themes/default/images/main.png" width="80" height="35"
/></div></th><th width="79" scope="col"><div align="right"><a href="classes/BHL_Register.php"><img
src="Themes/default/images/signup.png" width="80" height="35" /></div></th><th width="80" scope="col"><div align="right"><a
href="oper/members.php"><img src="Themes/default/images/members.png" width="80" height="35" /></div></th><th width="80"
scope="col"><div align="right"><a href="oper/accessin.php"><img src="Themes/default/images/signin.png" width="80"
height="35"/></div></th><th width="81" scope="col"><div align="right"><a href="docs.php"><img
src="Themes/default/images/docs.png" width="80" height="35" /></div></th><th width="81" scope="col"><div align="right"><a
href="download.php"><img src="Themes/default/images/download.png" width="80" height="35" /></div></th><th width="81"
scope="col"><div align="right"><a href="faq.php"><img src="Themes/default/images/qu.png" width="80"
height="35" /></div></th><th width="81" scope="col"><div align="right"><a href="bugs.php"><img
src="Themes/default/images/pro.png" width="80" height="35" /></div></th><th width="81" scope="col"><div align="right"><a
href="readme.php"><img src="Themes/default/images/readme.png" width="80" height="35" /></div></th>
<th width="87" scope="col"><div align="right"><a href="readme.php"><img src="Themes/default/images/readme.png" width="80"
height="35" /></div></th></tr></table></div></th></tr></table></div></th></tr></table><p class="style1"></p>
<map name="Map" id="Map"><area shape="poly" coords="-48,56" href="#" /></map><br />
<b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>/home/dothost.eu/vhosts/bhl.43i.net/index.php</b> on line <b>69</b><br />
<table width="860" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><th scope="col">
<tr>

<th scope="col"><table width="150" border="1" align="right" cellpadding="0" cellspacing="0">
<tr>
<th scope="col"><a
href="index.php"><img src="Themes/default/images/main2.png" width="150" height="40" /></th>
</tr>
<tr>
<th scope="col"><a
href="oper/article.php"><img src="Themes/default/images/article.png" width="150" height="40" /></th>
</tr>
<tr>
<th scope="col"><a
href="callus.php"><img src="Themes/default/images/callus.png" width="150" height="40" /></th>

</tr>
<tr>
<th scope="col"><HTML>
<BODY>

<!--dothost.eu "' --><script type="text/javascript"><!--
dothost_ad_format = "verify";
//--></script><script type="text/javascript" src="http://dothost.eu/abc/abc.js"></script><div style='position:absolute;display:none;'><a href='http://dothost.eu' title='Free Web Hosting'>Free Hosting</a></div>
<!--/dothost.eu-->
<table width="100%" border="1" align="right" cellpadding="1" cellspacing="1" bgcolor="#345677">
<tr><td align="center"><H1 style="margin-top: 0; margin-bottom: 0"><font face="Tahoma" size="3" >
تسجيل الدخول</font></H1>

<FORM METHOD="POST" ACTION="/index.php" >
</font><font face="Tahoma" size="2"><br>
اسم المستخدم:</font><font face="Tahoma" size="1" ><br>
<INPUT type="text" name="new_user" SIZE=15 MAXLENGTH=25 value=""/></font></font></p>
<P style="margin-top: 0; margin-bottom: 0"><font face="Tahoma">
<strong style="font-weight: 400"><font size="2">كلمة المرور:</font></strong><font size="2"><BR>
</font><font face="Tahoma" size="1">
<INPUT TYPE="password" name="password" SIZE=15 MAXLENGTH=25><br>
<P style="margin-top: 0; margin-bottom: 0">
</font><font face='Tahoma' size='2'>
<INPUT type='checkbox' name='remember' />حفظ البيانات<br/><br/></font></font></p>
<P style='margin-top: 0; margin-bottom: 0'><font face='Tahoma'>
<INPUT TYPE="submit" NAME="submit" VALUE="تسجيل دخول" style="font-family: Tahoma"></p></td></tr>
</table>

</FORM>
</BODY>
</HTML></th>
</tr>
<tr>
<th scope="col"><table width="150" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#345677">
<tr>
<th width="150" height="30" scope="col"><div align="center">إجمالي الإحصائيات</div></th>
</tr>
<tr>

<th width="150" height="30" scope="col"><div align="right">الأعضاء: 1</div></th>
</tr>
<tr>
<th width="150" height="30" scope="col"><div align="right">المقالات: 0</div></th>
</tr>
<tr>
<th width="150" height="30" scope="col"><div align="right">التعليقات: 0</div></th>

</tr>
<tr>
<th width="150" height="30" scope="col"><div align="right">الأقسام: 0</div></th>
</tr>
</table></th>
</tr>
<tr>
<th scope="col"><table width="150" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#345677">

<tr>
<th width="150" bordercolor="#FFFFFF" bgcolor="#345677" height="30"scope="col">آخر عضوية</th>
</tr>
</table<table width="150" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#345677">
<tr>
<th width="150" bgcolor="#345677" height="30"align="right" scope="col"><a href="
/index.php?Uid=1">aaa</a></th>
</tr>
</table></th>

</tr>
</table>
<table width="700" border="0" align="right" cellpadding="0" cellspacing="0" bordercolor="#996600">
<tr>
<th scope="col"></th>
</tr>
<tr>
<th align="right" scope="col"></th>
</tr>

<tr>
<th scope="col"><table width="700" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#CFDAE5"><tr>
<th width="400" align="right" scope="col">آخر المقالات</th></tr></table></th></tr>
</table></th>
</tr>
</table><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<style type="text/css">
<!--
body,td,th {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
body {
background-color: #FFFFFF;
background-repeat: no-repeat;
}
.style2 {color: #000000}
.style3 {
font-weight: bold;
color: #000000;
}
-->
</style></head>

<body>
<table width="860px" border="1" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td height="70" bgcolor="#345677"><div align="right" class="style2">
<div align="center"><span class="moduletable center"><span class="smalltext style3" style="display: inline; visibility: visible; font-family: Verdana,Arial,sans-serif;"><a href="http://www.bhl.org/" title="BHLsimpleTOOL Formal Website" target="_blank">Powered by BHLsimpleTOOL v1.0 Alpha 1</a> | <a href="http://www.bhl.org/" title="BHLsimpleTOOL Formal Website" target="_blank">BHLsimpleTOOL</a><a href="http://www.bhl.org/about/copyright.php" title="Free Script Software" target="_blank"> آ 2007-2008, </a><a href="http://www.bhl.org/" title="BHLsimpleTOOL Formal Website" target="_blank">BHLsimpleTOOL Office</a></span></span></div>

</div></td>
</tr>
</table>
</body>
</html>
<style type="text/css">
<!--
body,td,th {
font-family: Tahoma, Arial, Times New Roman;
font-size: 12px;
color: #000000;
}
body {
background-color: #FFFFFF;
background-repeat: no-repeat;
}
.style1 {color: #333333}
.style2 {color: #000000}
.style3 {color: #FFFFFF}
.style4 {
font-weight: bold;
color: #000000;
}
-->
</style></th>
</tr>
</table>


Start here for help (http://validator.w3.org/check?uri=http%3A%2F%2Fbhl.43i.net%2F&charset=(detect+automatically)&doctype=Inline&group=0) getting the page to render correctly. :)

vividona
11-16-2008, 05:52 PM
aha

I know I am an old Fashion

I am testing smarty now

plz help