| Author | problem with Audio module in mainfile.php |
soc Newbie

Joined: Sep 30, 2003 Posts: 2
Location: USA
|
 |
|
Hello there
I just tried to install audio module(i have phpnuke 6.5) , but there are some problems.
I put in mainfile.php this code :
$num = sql_num_rows(sql_query("select * from ".$prefix."_audio_newaudio", $dbi), $dbi);
$modreqa = sql_num_rows(sql_query("select * from ".$prefix."_audio_modrequest where brokenaudio='0'", $dbi), $dbi);
$brokena =sql_num_rows(sql_query("select * from ".$prefix."_audio_modrequest where brokenaudio='1'", $dbi), $dbi);
$content .= "<strong>·</strong> <a href=\"admin.php?op=Audio\">"._AUDIO."</a>: $num ";
$content .= "<strong>·</strong> <a href=\"admin.php?op=audioListModRequests\">"._MODREQAUDIO."</a>: $modreqa ";
$content .= "<strong>·</strong> <a href=\"admin.php?op=audioListBrokenaudio\">"._BROKENAUDIO."</a>: $brokena ";
in the end of the function and before themesidebox($title, $content);
but with this it says me that :
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /virtuals/mysite/public_html/html/includes/sql_layer.php on line 238
Anyone can you help me?
Thanks |
|
Posted:
Tue Sep 30, 2003 12:21 pm |
|
 |
planedoctor Site Admin


Joined: Oct 08, 2002 Posts: 306
|
|
Try Copying this directly
| Code: |
$num = $db->sql_numrows($db->sql_query("select * from ".$prefix."_audio_newaudio"));
$modreqa = $db->sql_numrows($db->sql_query("select * from ".$prefix."_audio_modrequest where brokenaudio='0'"));
$brokena = $db->sql_numrows($db->sql_query("select * from ".$prefix."_audio_modrequest where brokenaudio='1'"));
$content .= "<strong><big>·</big></strong> <a href=\"admin.php?op=Audio\">"._AUDIO."</a>: $num<br>";
$content .= "<strong><big>·</big></strong> <a href=\"admin.php?op=audioListModRequests\">"._MODREQAUDIO."</a>: $modreqa<br>";
$content .= "<strong><big>·</big></strong> <a href=\"admin.php?op=audioListBrokenaudio\">"._BROKENAUDIO."</a>: $brokena<br>"; |
Let me know if you have any other problems
Sorry I forgot to apply changes to this code in the download. _________________
|
|
Posted:
Tue Sep 30, 2003 2:22 pm |
|
 |
soc Newbie

Joined: Sep 30, 2003 Posts: 2
Location: USA
|
|
I modified code to this and it works ok now. As i can see it is the same code with this you just posted.
| Code: |
$num = $db->sql_numrows($db->sql_query("select * from ".$prefix."_audio_newaudio"));
$brokena = $db->sql_numrows($db->sql_query("select * from ".$prefix."_audio_modrequest where brokenaudio='1'"));
$modreqa = $db->sql_numrows($db->sql_query("select * from ".$prefix."_audio_modrequest where brokenaudio='0'"));
$content .= "<strong><big>·</big></strong> <a href=\"admin.php?op=Audio\">"._AUDIO."</a>: $num<br>";
$content .= "<strong><big>·</big></strong> <a href=\"admin.php?op=audioListModRequests\">"._MODREQAUDIO."</a>: $modreqa<br>";
$content .= "<strong><big>·</big></strong> <a href=\"admin.php?op=audioListBrokenaudio\">"._BROKENAUDIO."</a>: $brokena<br>"; |
|
|
Posted:
Tue Sep 30, 2003 2:28 pm |
|
 |
planedoctor Site Admin


Joined: Oct 08, 2002 Posts: 306
|
|
Well it's close but the query to the DB has changed in the newer version of Nuke.
Check out this line and look at the query
| Code: |
| $num = sql_num_rows(sql_query("select * from ".$prefix."_audio_newaudio", $dbi), $dbi); |
Now here is the new call
| Code: |
| $num = $db->sql_numrows($db->sql_query("select * from ".$prefix."_audio_newaudio")); |
See the difference?
I have updated the download file with the new changes!  _________________
|
|
Posted:
Tue Sep 30, 2003 2:38 pm |
|
 |
|