Author |
Message |
jaded
Theme Guru

Joined: Nov 01, 2003
Posts: 1006
|
Posted:
Sun Feb 08, 2009 3:13 pm |
|
I upgraded a website that was running nuke 7.0 to RN 2.3.
There are a few errors with addon modules.
Your help would be greatly appreciated.
This is the Profiles module with can be seen working on my website here, http://www.jaded-designs.com/modules.php?name=Profiles
This module is very important to this woman's website and I would like to get it functional without errors again.
Code:
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /home2/***/public_html/modules/Profiles/index.php on line 479
|
Code:Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home2/****/public_html/modules/Profiles/index.php on line 215
|
Here are lines 454-481 of the modules/Profiles/index.php file
Code:#########################################################
# Submit Review #
#########################################################
function submit_proview($username, $comment, $rank, $rpid, $id) {
global $prefix, $dbi, $username, $rank, $comment;
$date = date("m-d-Y h:i a");
mysql_query("insert into ".$prefix."_tri_proview values ('$id','$username','$rank','$comment','$date','delkey')", $dbi);
header("Location: modules.php?name=Profiles&id=$id");
}
switch($op) {
default:
index($prid);
break;
case "submit_proview":
submit_proview($username, $comment, $rank, $rpid, $id);
break;
}
mysql_close($dbi);
include("footer.php");
?>
|
Here are lines 211-220
Code: $limitvalue = $page * $limit - ($limit);
$sql2 = "SELECT * FROM ".$prefix."_tri_profiles where category='$cid' ORDER by common LIMIT $limitvalue, $limit";
$query2 = mysql_query($sql2) or die("Error: " . mysql_error());
if(mysql_num_rows($result) == 0){
echo("Nothing to Display!");
}
//$sql2="select * from ".$prefix."_tri_profiles where category='$cid' ORDER BY common";
//$query2 = mysql_query($sql2);
|
|
_________________ Themes BB Skins
http://www.jaded-designs.com
Graphic Tees
http://www.cafepress.com/jadeddesigns
Paranormal Tees
http://www.cafepress.com/HauntedTees
Ghost Stories & More
http://www.hauntingtales.net
Last edited by jaded on Sun Feb 08, 2009 4:37 pm; edited 1 time in total |
|
|
 |
Palbin
Site Admin

Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Sun Feb 08, 2009 3:28 pm |
|
It uses the old $dbi layer as stated in one of your other issues. You need to convert it to the $db layer or enable the $dbi layer again. Both are located here in the forums. |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
 |
jaded

|
Posted:
Sun Feb 08, 2009 3:30 pm |
|
I have done that and it did not fix the error. It corrected it with the Contact Plus module, but not with this Profiles module. |
|
|
|
 |
Palbin

|
Posted:
Sun Feb 08, 2009 4:04 pm |
|
I think you can just comment out the mysql_close($dbi);.
Try changing:
Code:
if(mysql_num_rows($result) == 0){
|
To:
Code:
if(sql_num_rows($result, $dbi) == 0){
|
|
|
|
|
 |
Palbin

|
Posted:
Sun Feb 08, 2009 4:06 pm |
|
jaded wrote: | I have done that and it did not fix the error. It corrected it with the Contact Plus module, but not with this Profiles module. |
I guess I should have asked. When you said that it corrected it did you change the $dbi to $db or uncomment the stuff in mainfile.php. |
|
|
|
 |
dad7732
RavenNuke(tm) Development Team

Joined: Mar 18, 2007
Posts: 1242
|
Posted:
Sun Feb 08, 2009 4:06 pm |
|
Try these:
I assume the first two you posted were just the error messages.
Code:#########################################################
# Submit Review #
#########################################################
function submit_proview($username, $comment, $rank, $rpid, $id) {
global $prefix, $db, $username, $rank, $comment;
$date = date("m-d-Y h:i a");
$db->sql_query("insert into ".$prefix."_tri_proview values ('$id','$username','$rank','$comment','$date','delkey')");
header("Location: modules.php?name=Profiles&id=$id");
}
switch($op) {
default:
index($prid);
break;
case "submit_proview":
submit_proview($username, $comment, $rank, $rpid, $id);
break;
}
$db->sql_close($db);
include("footer.php");
?>
|
Code: $limitvalue = $page * $limit - ($limit);
$sql2 = "SELECT * FROM ".$prefix."_tri_profiles where category='$cid' ORDER by common LIMIT $limitvalue, $limit";
$query2 = $db->sql_query($sql2) or die("Error: " . $db->sql_error());
if($db->sql_numrows($result) == 0){
echo("Nothing to Display!");
}
//$sql2="select * from ".$prefix."_tri_profiles where category='$cid' ORDER BY common";
//$query2 = $db->sql_query($sql2);
|
Hope so ...
Cheers |
|
|
|
 |
jaded

|
Posted:
Sun Feb 08, 2009 4:36 pm |
|
Hello,
These changes from Dad7732 removed the notices in this module. I have not found any additonal ones within the module as of now. I truly appreciate your help with this. Thank you both! |
|
|
|
 |
dad7732

|
Posted:
Sun Feb 08, 2009 4:55 pm |
|
My info and help is solely dependant on the crew here. I went through the same thing a while back and it's easy to miss a step or two just when you KNOW you modified everything.
Cheers |
|
|
|
 |
|