|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-04-28 09:07 UTC] derick@php.net
[2004-05-01 13:13 UTC] email at philbert dot nl
[2004-05-05 22:40 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 09:00:01 2025 UTC |
Description: ------------ class RSSitem { var $dblink; var $success = false; var $items; var $currentItem; function RSSitem($pDBname, $pUsername, $pPassword) { $this->$dblink = mysql_connect("localhost:3306",$pUsername, $pPassword); if (mysql_select_db($pDBname, $this->$dblink)) { $query = "select id " . " , title " . " , description " . " , guid " . " , link " . " , pubDate " . "from item " . "order by id desc"; $this->$items = mysql_query($query, $this->$dblink); if ($this->$items) { $this->$currentItem = mysql_fetch_assoc($this->$items); if ($this->$currentItem) { $this->success = true; //print_r($this->$currentItem); } } } } function title() { $value = $this->$currentItem["title"]; return $value; } } When an object of class RSSitem is made, and the function object.title() is called, it returns the entire array $this->$currentItem, instead of entry ["title"] of this array. When I rewrite the function thus: function title() { $temparray = $this->$currentItem; $value = $temparray["title"]; return $value; } it does work.