FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


whats the error?





devroom
i want to build my own pms system. but there seems to be an error somewhere. But i dont know which one.
This is the error:
"Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/devroom/domains/devroom.frih.net/public_html/test/components/com_c-pms/inbox.php on line 35"

Does somebody know it?, its probably very simple and i cant find it Evil or Very Mad

Code:
<?php
##########################################################
## Title........: C-PMS
## Description..: A Private Messaging System for Joomla
## Author.......: Cas de Vroom
## Version......: 1.0 Beta
## Created......: 11/06/2006
## Contact......: webmaster@devroom.frih.net
## Joomla Version: designed on 1.0.X.
##########################################################
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

echo '<tr>
   <th>&nbsp;</th><th>'._CPMS_FROM.'</th><th>'._CPMS_SUBJECT.'</th><th>'._CPMS_REPLIED.'</th><th>'._CPMS_DATETIME.'</th>
</tr>';

$query = "SELECT count(id) FROM #__cpms_inbox WHERE username='$my->username'";
$database->setQuery($query);
$total = $database->loadResult();

if (empty($limitstart)) $limitstart = 0;
$limit = 10;//$rows_per_page
if ($limit > $total) {
$limitstart = 0;
}

$message = "SELECT id,username,from_user,readed,replied,allowreply,trash,subject,message,sentdatetime FROM #__cpms_inbox WHERE username='$my->username' ";
$message .= " order by id DESC";
$message .= " LIMIT $limitstart, $limit";

$database->setQuery($message);
$result = $database->query();

if (mysql_num_rows($result)<1) {
echo '<tr><td colspan="5">'._CPMS_NO_MESSAGES.'</td></tr>';
} else {

echo '<tr>
   <td><input name="'.$showrow['id'].'" type="checkbox" /></td>';
echo'   <td>'.$showrow['from_user'].'</td>';
echo'   <td>'.$showrow['subject'].'</td>';
echo'   <td>'.$showrow['replied'].'</td>';
echo'   <td>'.$showrow['datetime'].'</td>
</tr>'; }

?>
DudeAmI0
Where did you define $showrow
Maybe:
Code:
$showrow = mysql_fetch_assoc($result)
or
while ($showrow = mysql_fetch_assoc) {
  /* Code here */
}


You using a different style then i am, so i dunno... ussually thats my problem...
devroom
DudeAmI0 wrote:
Where did you define $showrow
Maybe:
Code:
$showrow = mysql_fetch_assoc($result)
or
while ($showrow = mysql_fetch_assoc) {
  /* Code here */
}


You using a different style then i am, so i dunno... ussually thats my problem...


yeah it works now thx Very Happy
DudeAmI0
Just glad i could help
Related topics
Help: SQL error after uploading new files(thread updated)
Whats it like?
Great php editor
Error 404 ..... How to Hide ...
Can't CHMOD Folder
fantastico error
ERROR: Nameserver ns1.frihost.net is not authoritative
[solved] Weird mysql error
Parse error: syntax error, unexpected T_NEW
can we use TTF fonts and if so whats the path?
Error 500
.tk error!
WIN 32 generic host error
Java applet error.
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.