I am working in PHP/MySQL.
I have a table in my database called hourly in that table their is a column named webaddress these are serialized. There are multiple rows of each column of webaddresses each is serialized.
I need to pull each row, unserailize them then put them into an array.
I tried using this bit of code but it only grabs 1 row because of the limitations of the PHP functions.
while ($row = mysql_fetch_array($results)) {$test = unserialize($row[0]);}
I was thinking something like this might work:
while(($row = mysql_fetch_array($results)) !== FALSE) {$test[] = $row;}
That didn't work ...
How can I grab each row, then unserailize it then add it to an array? I just need the data in the web_addresses field currently there is 3 rows of data. So there would be 3 serialized arrays in each web_addresses field that I need to unserialize and combine into another array. Hopefully that makes more sense.
Here is the MySQL table:
CREATE TABLE `hourly` (
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`id` bigint(20) NOT NULL auto_increment,
`month` longtext NOT NULL,
`day` longtext NOT NULL,
`year` longtext NOT NULL,
`source` longtext NOT NULL,
`web_address` longtext NOT NULL,
`at_replies` longtext NOT NULL,
`words` longtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1