Hi, I’m banging my head against a brick wall trying to figure this one out…
I have this array….
[code=php]
<?php
array (
‘ebay_mode’ => ‘sandbox’,
‘sitename’ => ‘The On-line Chemical & Packaging Experts’,
‘timezone’ => ‘+6’,
‘header_image_max_height’ => ‘150’,
)
?>
I have serialized it and inserted it into the database and it looks like this…
[code=php]
<?php
a:4:{s:9:”ebay_mode”;s:7:”sandbox”;s:8:”sitename”;s:59:”APC-Pure.com – The On-line Chemical & Packaging Experts”;s:8:”timezone”;s:2:”+6″;s:23:”header_image_max_height”;s:3:”150″;}
?>
I have a working query…
[code=php]
<?php
$preferences = mysql_query(“SELECT * FROM preferences WHERE pref_name = ‘siteprefs'”) or die (mysql_error());
while ($prefs = mysql_fetch_array($preferences))
{
$pref = unserialize($prefs[‘pref_value’]);
}
?>
The wierd thing is this was working!! I don’t think I changed anything as I have been working on something else but I suppose there may be a conflict somewhere. I just can’t find it!!
[code=php]
<?php
echo $pref[‘sitename’];
?>
The above echo statement gives me nothing at all on screen!! Very frustrating as I’m going to feel like a right numpty if someone points out a silly error somewhere!!
Hoping someone does ?
Regards
Smithster