Hi-
I have a variable ($content) that is inserted multiple times into a mysql database using a foreach loop from an array.
I am now trying to set its value ($content) based on items in an array ($ar_propnames).
For some reason i only get the last array item inserted. When i comment out all the if clauses, i get 10 (but all with the same $content value)
Is there something simple i'm missing?
I hope this is clear..
Thanks
$content = "some text from a form";
$ar_propnames = array ("content_en", "target", "image", "thumbnail", "extra1", "extra2", "extra3", "searchable", "pagedata", "disable_wysiwyg");
foreach ($ar_propnames as $prop_value) {
if ($prop_value = "image") $content ="-1" ;
if ($prop_value = "thumbnail") $content ="-1" ;
if ($prop_value = "disable_wysiwyg") $content ="0" ;
if ($prop_value = "searchable") $content ="1" ;
if ($prop_value = "extra1") $content ="" ;
if ($prop_value = "extra2") $content ="" ;
if ($prop_value = "extra3") $content ="" ;
if ($prop_value = "target") $content ="" ;
if ($prop_value = "pagedata") $content ="" ;
## then goes on to mysql_query to check update or insert