1
mikedev10
php errors; why?
  • 2005/5/23 4:21

  • mikedev10

  • Just popping in

  • Posts: 8

  • Since: 2005/5/21


i'm getting this basic php errors in kernel\user.php - can anyone tell me why? i am at a loss.

Warning [PHP]: mysql_num_rows(): supplied argument is not a valid MySQL result resource in file kernel/user.php line 608
Warning [PHP]: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in file kernel/user.php line 609

from

607     $resultMembers $this->db->query($sqlMembers);
608     $numMembers mysql_num_rows($resultMembers);
609     $rowNewPres mysql_fetch_array($resultMembers);


i don't see what the problem is; i tried changing 607 to

$resultMembers mysql_query($sqlMembers);

but that didn't help either. please advise!

2
smdcom
Re: php errors; why?

$sqlMembers = ?

what exactly you want to alter from kernel user?

3
mikedev10
Re: php errors; why?
  • 2005/5/23 4:39

  • mikedev10

  • Just popping in

  • Posts: 8

  • Since: 2005/5/21


$sqlMembers "select uid from xoops_users where uni_id = $rowCurInfo[uni_id] and level > 0 order by user_regdate where status < 3";


i added a field to xoops_user, based on some logic i am populating another table that i created and am doing so in user.php

4
mikedev10
Re: php errors; why?
  • 2005/5/29 8:16

  • mikedev10

  • Just popping in

  • Posts: 8

  • Since: 2005/5/21


bump

5
mikedev10
Re: php errors; why?
  • 2005/5/29 9:33

  • mikedev10

  • Just popping in

  • Posts: 8

  • Since: 2005/5/21


fixed, should use

query() - execute a query. Note that if the request method is GET, this method will only accept SELECT queries. Returns a database resultset
queryF() - force an execution of a query without regard to request method. USE WITH CAUTION!!!
getRowsNum($resultset) - returns number of rows in a resultset
getAffectedRows() - returns number of rows changed by a query
getInsertId() - returns the auto_increment id of the latest insertion query
fetchRow($resultset) - returns an array of values from a row, indexed by number ($row?0, $row?1 etc.)
fetchArray($resultset) - returns an array of values from a row, indexed by fieldname ($row?'field1', $row?'field2' etc.)
quoteString($string) - ensures that a string is inserted in the database with proper quotes to avoid e.g. SQL injection

Login

Who's Online

384 user(s) are online (88 user(s) are browsing Support Forums)


Members: 0


Guests: 384


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits