Reading tags in mysql from [comments_all]

Locked
Herbert
User
Posts: 2
Joined: Fri Dec 26, 2014 10:52 am
Are you a spambot?: no

Reading tags in mysql from [comments_all]

Post by Herbert » Fri Dec 26, 2014 12:07 pm

Hello,
I use demo.mysql.php to put everthing in MySQL
How can i read the year (s:4:"year";a:1:{i:0;s:4:"2014";) in field [comments_all] with a external script?
Can someone give me a example?

Many thanks..

James Heinrich
getID3() v1 developer
Posts: 1457
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: Reading tags in mysql from [comments_all]

Post by James Heinrich » Sat Dec 27, 2014 3:15 pm

Code: Select all

$sql = 'SELECT `comments_all` WHERE (`filename` = "'.mysql_real_escape_string($filename).'")';
$result = mysql_query($SQLquery);
if ($row = mysql_fetch_assoc($result)) {
  if ($comments_all = @unserialize($row['comments_all']))) {
    $year = $comments_all['year'][0];
  }
}

Herbert
User
Posts: 2
Joined: Fri Dec 26, 2014 10:52 am
Are you a spambot?: no

Re: Reading tags in mysql from [comments_all]

Post by Herbert » Wed Jan 14, 2015 6:42 am

Thank u verry much James!

Locked