weeder Posted June 16, 2009 Share Posted June 16, 2009 I get this error Fatal error: Cannot use string offset as an array in /home/domain/public_html/NCADM/CatDetails.php on line 52 Server is on php5 can anyone help please, I am very green first part of code where i believe error is define("RelativePath", "."); include(RelativePath . "/Common.php"); include(RelativePath . "/Template.php"); include(RelativePath . "/Sorter.php"); include(RelativePath . "/Navigator.php"); //End Include Common Files //Include Page implementation @33-503267A8 include("./Header.php"); //End Include Page implementation $details = new clsDBNetConnect; $details->query("select * from category_details"); $mods = ""; while ($details->next_record()){ $mods[$details->f("cat_id")]["field"] = $details->f("field"); $mods[$details->f("cat_id")]["template"] = $details->f("template"); $mods[$details->f("cat_id")]["storefront"] = $details->f("storefront"); $mods[$details->f("cat_id")]["pricing"] = $details->f("pricing"); } $groups = ""; $details->query("select c.group_id, c.cat_id, g.title from groups_categories c, groups g where c.group_id = g.id"); while ($details->next_record()){ //print $details->f("cat_id"); if (isset($groups[$details->f("cat_id")])) $groups[$details->f("cat_id")] .= ", " . $details->f("title"); else $groups[$details->f("cat_id")] = $details->f("title"); } $cattable = " <table border=\"1\" cellspacing=\"1\" width=\"350\">\n"; $cattable .= " <tr>\n"; $cattable .= " <TD class=DeepWaterFieldCaptionTD align=\"middle\" width=\"175\"><font size=\"2\">Category Details</font></td>\n"; $cattable .= " <TD class=DeepWaterFieldCaptionTD align=\"middle\" width=\"75\"><font size=\"2\">Group</font><br>\n"; $cattable .= " <font size=\"2\">Membership</font></td>\n"; $cattable .= " </tr>\n"; Link to comment https://forums.phpfreaks.com/topic/162374-cannot-use-string-offset-as-an-array/ Share on other sites More sharing options...
joel24 Posted June 16, 2009 Share Posted June 16, 2009 which line is line52? Link to comment https://forums.phpfreaks.com/topic/162374-cannot-use-string-offset-as-an-array/#findComment-857028 Share on other sites More sharing options...
weeder Posted June 16, 2009 Author Share Posted June 16, 2009 line 52 is if ($mods[$catlist->f("cat_id")]["storefront"] == 1){ $cattable .= " <img border=\"0\" src=\"Themes/DeepWater/custtemplate.gif\">"; Link to comment https://forums.phpfreaks.com/topic/162374-cannot-use-string-offset-as-an-array/#findComment-857034 Share on other sites More sharing options...
premiso Posted June 16, 2009 Share Posted June 16, 2009 Read this and make sure you are calling your data right. http://informationideas.com/news/2006/06/14/fatal-error-cannot-use-string-offset-as-an-array-in/ Found via google with "Cannot use string offset as an array". Link to comment https://forums.phpfreaks.com/topic/162374-cannot-use-string-offset-as-an-array/#findComment-857132 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.