Hallo,
habe ein kleines Prob. Hab mir ein Script installiert das bis auf diesen Fehler problemlos funktioniert.
Wenn ich Das Script ausführe, also im Memberbereich die ID's updaten möchte kommt folgende Fehlermeldung:
Die Einträge ändern sich, also die DB Einträge werden geändert. Nur erscheint eben jedesmal diese blöde Fehlermeldung.
Da ich von der Materie null Ahnung habe hoffe ich das mir vielleicht jemand helfen kann
habe ein kleines Prob. Hab mir ein Script installiert das bis auf diesen Fehler problemlos funktioniert.
Wenn ich Das Script ausführe, also im Memberbereich die ID's updaten möchte kommt folgende Fehlermeldung:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/.pinkish/p2dlc/paid2-downline-club.info/updateprograms.php on line 70
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/.pinkish/p2dlc/paid2-downline-club.info/updateprograms.php on line 88
Die Einträge ändern sich, also die DB Einträge werden geändert. Nur erscheint eben jedesmal diese blöde Fehlermeldung.
Da ich von der Materie null Ahnung habe hoffe ich das mir vielleicht jemand helfen kann
PHP:
<?
session_start();
session_register("username_session");
session_register("password_session");
include "header.php";
include "config.php";
if (!isset($_SESSION["username_session"]))
{
?>
<form action=login.php method=post>
<br><br><Center><table><tr><td colspan=2 align=center><h3>Members Login Area</h3></td></tr>
<tr><td>Username</td><td><input type=text name=id></td></tr>
<tr><td>Password</td><td><input type=password name=password></td></tr>
<tr><td> </td><td>
<a href="forgot.php" onclick="doexit=false;"><font face="Verdana,Arial,Helvetica" size="1" color="#000000"><b>Forgot Your Password?</b></font></a></td></tr>
<tr><td colspan=2 align=center><input type=submit value="Log In"></td></tr>
</table></form>
<? }
else
{
middle();
}
function middle()
{
extract($GLOBALS);
include "config.php";
?>
<table border="0" width="650">
<tr>
<td width="100" valign="top">
<table width="100">
<tr>
<td align="left"><br><br><br><br>
<ul><font face="verdana" size="1">
<a href="stats.php">Members Home</a><br><br>
<a href="updateprograms.php">Update Programs Info</a><br><br>
<a href="addprograms.php">Add/Edit New Programs</a><br><br>
<a href="withdrawal.php">Withdrawal</a><br><br>
<a href="update_pf.php">Profile</a><br><br>
<a href="logout.php">Logout</a><br><br>
</td></tr></table>
</td>
<td VALIGN="top" width=550>
<table width=550>
<tr>
<td>
<font face="verdana" size="3"><b>
<p><center><? echo $sitename; ?> Programs</center></b></font></p><font face=verdana size=2>
<?
$memuser=$_SESSION["username_session"];
if($_POST) {
foreach($_POST as $k=>$v) {
if($k!="p") {
$mailbody .=$k." = ".$v."\r\n";
}
}
$d=Split("\r\n",$mailbody);
for($i=0;$i<count($d)-1;$i++) {
$dataa=split(" = ",$d[$i]);
$dataa[0]=eregi_replace("username","",$dataa[0]);
$rs=mysql_query("select * from programs where ID=".$dataa[0]);
if(mysql_num_rows($rs)>0) {
$arr=mysql_fetch_array($rs);
$user="admin";
$rss=mysql_query("select * from membersprograms where Username='$memuser' and PID=$arr[0]");
if(mysql_num_rows($rss)>0) {
$rss=mysql_query("update membersprograms set affiliateid='".$dataa[1]."' where Username='$memuser' and PID=$arr[0]");
}
else {
if($dataa[1]=="") {
}
else {
$sql="insert into membersprograms(Username,PID,affiliateid) values ('$memuser',$arr[0],'$dataa[1]')";
mysql_query($sql);
}
}
}
else {
$rs=mysql_query("select * from memprograms where ID=".$dataa[0]);
if(mysql_num_rows($rs)>0) {
$arr=mysql_fetch_array($rs);
$user=$memuser;
$rss=mysql_query("select * from membersprograms where Username='$memuser' and PID=$arr[0]");
if(mysql_num_rows($rss)>0) {
$rss=mysql_query("update membersprograms set affiliateid='".$dataa[1]."' where Username='$memuser' and PID=$arr[0]");
}
else {
if($dataa[1]=="") {
}
else {
$sql="insert into membersprograms(Username,PID,affiliateid) values ('$memuser',$arr[0],'$dataa[1]')";
mysql_query($sql);
}
}
}
}
}
echo "<br><br><b>Records Updated Successfully</b><br>";
}
$result=mysql_query("Select * from users where Username='$_SESSION[username_session]'");
$rs=mysql_fetch_row($result);
$ref_by=$rs[11];
if($ref_by=="") {
$user="admin";
}
else {
$rs=mysql_query("select * from users where Username='$ref_by'");
if(mysql_num_rows($rs)>0) {
$user=$ref_by;
}
else {
$user="admin";
}
}
?>
<center>
<table border="1" cellpadding="0" cellspacing="0" width="90%">
<form method=post>
<?
$ref_by=$user;
if($ref_by=="admin") {
$ref_by="";
}
$i=0;
//************ For the user own programs
$sql = "Select * from memprograms where Username='$memuser' and system=1 order by ID";
$result = mysql_query($sql);
if(mysql_num_rows($result)>0) {
echo "<tr><td colspan=2><b><u><font face=verdana size=2 color=red>Your's Added Program(s)</font></b></u></td></tr>";
while($arr=mysql_fetch_array($result)) {
$affiliateid="";
$affiliateid1="";
$rs1=mysql_query("select * from membersprograms where Username='$memuser' and PID=$arr[0]");
if(mysql_num_rows($rs1)>0) {
$arr1=mysql_fetch_array($rs1);
$affiliateid=$arr1[3];
$affiliateid1=$arr1[3];
}
else {
$affiliateid="";
}
$url=str_replace("{affiliateid}",$affiliateid,$arr[2]);
echo "<tr><td><font face=verdana size=2>
<a href=$url target=_blank><b>$arr[1]</b></a></td><td><font face=verdana size=2>
Affiliate ID/Username:<input type=text name=username$arr[0] value='$affiliateid1' size=10></td></tr>
<tr><td colspan=2><font face=verdana size=2>
$arr[3]
</td></tr>
";
}
}
//*********For the user own programs
if($levels>0) {
while($i<$levels) {
$i++;
$sql = "Select * from memprograms where Username='$ref_by' and system=1 order by ID";
$result = mysql_query($sql);
if(mysql_num_rows($result)>0) {
echo "<tr><td colspan=2><b><u><font face=verdana size=2 color=red>Level $i Sponsor's Recommended Program(s)</font></b></u></td></tr>";
while($arr=mysql_fetch_array($result)) {
$affiliateid="";
$affiliateid1="";
$rs1=mysql_query("select * from membersprograms where Username='$memuser' and PID=$arr[0]");
if(mysql_num_rows($rs1)>0) {
$arr1=mysql_fetch_array($rs1);
$affiliateid=$arr1[3];
}
else {
$rs1=mysql_query("select * from membersprograms where Username='$user' and PID=$arr[0]");
if(mysql_num_rows($rs1)>0) {
$arr1=mysql_fetch_array($rs1);
$affiliateid=$arr1[3];
}
else {
$rs1=mysql_query("select * from membersprograms where Username='$ref_by' and PID=$arr[0]");
if(mysql_num_rows($rs1)>0) {
$arr1=mysql_fetch_array($rs1);
$affiliateid=$arr1[3];
}
else {
$affiliateid="";
}
}
}
$url=str_replace("{affiliateid}",$affiliateid,$arr[2]);
echo "<tr><td><font face=verdana size=2>
<a href=$url target=_blank><b>$arr[1]</b></a></td><td><font face=verdana size=2>
Affiliate ID/Username:<input type=text name=username$arr[0] value='$affiliateid1' size=10>(i.e. $affiliateid)</td></tr>
<tr><td colspan=2><font face=verdana size=2>
$arr[3]
</td></tr>
";
}
}
$sql = "Select * from users where Username='$ref_by'";
$result = mysql_query($sql);
if(mysql_num_rows($result)>0) {
$arr=mysql_fetch_array($result);
$ref_by=$arr[11];
}
}
}
$rsc=mysql_query("select * from cats order by Name");
while($arrc=mysql_fetch_array($rsc)) {
$sql = "Select * from programs where catid=$arrc[0] order by ID";
$result = mysql_query($sql);
if(mysql_num_rows($result)>0) {
echo "<tr><td colspan=2><b><u><font face=verdana size=2 color=red>$arrc[1]</font></b></u></td></tr>";
while($arr=mysql_fetch_array($result)) {
$affiliateid="";
$affiliateid1="";
$rs1=mysql_query("select * from membersprograms where Username='$user' and PID=$arr[0]");
if(mysql_num_rows($rs1)>0) {
$arr1=mysql_fetch_array($rs1);
$affiliateid=$arr1[3];
}
else {
$rs1=mysql_query("select * from membersprograms where Username='admin' and PID=$arr[0]");
if(mysql_num_rows($rs1)>0) {
$arr1=mysql_fetch_array($rs1);
$affiliateid=$arr1[3];
}
else {
$affiliateid="";
}
}
$rs1=mysql_query("select * from membersprograms where Username='$memuser' and PID=$arr[0]");
if(mysql_num_rows($rs1)>0) {
$arr1=mysql_fetch_array($rs1);
//$affiliateid=$arr1[3];
$affiliateid1=$arr1[3];
}
$url=str_replace("{affiliateid}",$affiliateid,$arr[2]);
echo "<tr><td><font face=verdana size=2>
<a href=$url target=_blank><b>$arr[1]</b></a></td><td><font face=verdana size=2>
Affiliate ID/Username:<input type=text name=username$arr[0] value='$affiliateid1' size=10>(i.e. $affiliateid)</td></tr>
<tr><td colspan=2><font face=verdana size=2>
$arr[3]
</td></tr>
";
}
}
}
echo "<tr><td colspan=2><br><input type=submit value='Update Info'></td></tr>";
echo "</table>";
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<? return 1;
} include "footer.php";
?>