PEAK XOOPS - php 5.1.4: Fatal error: Cannot access empty property in ..../piCal_xoops.php on line 164 in englishin japanese

php 5.1.4: Fatal error: Cannot access empty property in ..../piCal_xoops.php on line 164

List posts in the topic

question php 5.1.4: Fatal error: Cannot access empty property in ..../piCal_xoops.php on line 164

msg# 1
depth:
0
Previous post - Next post | Parent - Children.1 .2 | Posted on 2006/8/2 4:28
katowulf  二等兵   Posts: 3
System Info
----------------
Linux 2.6.11-gentoo-r4 i686 AMD Athlon GNU/Linux
PHP Version 5.1.4-pl0-gentoo
Apache 2.0 with asapi module (mod_php)
piCal 0.76
XOOPS 2.0.14-rc1
----------------

The following error occurs while trying to access the userinfo.php page (View Account) if I have entered any items into the calendar:

Fatal error: Cannot access empty property in /home/www/users/carsonfcc/www/modules/piCal/class/piCal_xoops.php on line 164

This happens when mysql_fetch_object() is called:
[qoute]
// ??????
$rs = mysql_query( $sql , $this->conn ) ;

$ret = array() ;
$context = '' ;
$myts =& MyTextSanitizer::getInstance();
while( $event = mysql_fetch_object($rs) ) {

If I trade this line out for mysql_fetch_array($rs), the fatal error is cleared, but this doesn't work with the loop, of course.

I checked out the query and the $rs variable using:
Quote:
// ??????
$rs = mysql_query( $sql , $this->conn ) ;

$ret = array() ;
$context = '' ;
$myts =& MyTextSanitizer::getInstance();
print "[".var_dump($rs)."]$sql<br>";
$event = mysql_fetch_object($rs);
while( $event !== false ) {

Which produced:
Quote:
resource(120) of type (mysql result) []

SELECT id,uid,summary,UNIX_TIMESTAMP(dtstamp) AS udtstamp, start, end, allday, start_date, end_date, ''
FROM x_pical_event
WHERE admission>0
AND (rrule_pid=0 OR rrule_pid=id)
AND (1) AND (1) AND (1) AND (uid=1)
ORDER BY dtstamp DESC LIMIT 0,5

I can't seem to figure out why mysql_fetch_object() fails so miserably. Running the same query against the database produces:
Quote:
mysql> SELECT id,uid,summary,UNIX_TIMESTAMP(dtstamp) AS udtstamp, start, end, allday, start_date, end_date, '' FROM x_pical_event WHERE admission>0 AND (rrule_pid=0 OR rrule_pid=id) AND (1) AND (1) AND (1) AND (uid=1) ORDER BY dtstamp DESC LIMIT 0,5;
+------------+----------+------------+------------+------------+------------+--------+------------+----------+--+
| id | uid | summary | udtstamp | start | end | allday | start_date | end_date | |
+------------+----------+------------+------------+------------+------------+--------+------------+----------+--+
| 0000000001 | 00000001 | Test Event | 1151194036 | 1150819200 | 1150848000 | 0 | NULL | NULL | |
+------------+----------+------------+------------+------------+------------+--------+------------+----------+--+
1 row in set (0.00 sec)

Any thoughts on how to fix this, other than changing this to mysql_fetch_array() and editing the entire code loop to use the values from the array?
Votes:18 Average:5.56

Posts tree

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!