twkhub Posted October 24, 2009 Share Posted October 24, 2009 There is a data feed being imported on a old website that I and trying to move the code from one domain name to another. When i copy all the files to the new site ftp and try and createCatagories.php when i try and run this on the new site i get this error: Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /hsphere/local/home/tweekclo/tweekclothing.com/store/Skatefeed/createCategories.php on line 34 Heres the createcatagories.php code <?php ini_set("display_errors", "On"); //activeer de display_error require_once('items/category.php'); emptyDBs(); $topCatIds = createTopCats(); createSubCats($topCatIds); function emptyDBs(){ require_once('db.php'); mysql_query("delete from `categories_description` where 1 = 1"); mysql_query("delete from `categories` where 1 = 1"); } function createTopCats(){ $topCatIds = array(); addTopCategory(&$topCatIds, '1D', 'Decks'); addTopCategory(&$topCatIds, '1W', 'Wheels'); addTopCategory(&$topCatIds, '1C', 'Completes'); addTopCategory(&$topCatIds, '1T', 'Trucks'); addTopCategory(&$topCatIds, '', 'Accessoires'); addTopCategory(&$topCatIds, '', 'Protective Gear'); addTopCategory(&$topCatIds, '', 'Clothing'); addTopCategory(&$topCatIds, '', 'Media'); addTopCategory(&$topCatIds, '', 'Snow'); return $topCatIds; } function createSubCats($topCatIds){ $catArray = file('subcats.txt', FILE_IGNORE_NEW_LINES); foreach ($catArray as $key => &$cat) { $arr = explode("\t", $cat); $topCatId = $topCatIds[trim($arr[2])]; addCategory(trim($arr[0]), trim($arr[1]), $topCatId); } } function addTopCategory($topCatIds, $ess_id, $name){ $cat = new Category($ess_id, $name); $id = $cat->persist(); $topCatIds[$name] = $id; } function addCategory($ess_id, $name, $parentId){ if($ess_id != '' && $name != ''){ $cat = new Category($ess_id, $name, $parentId); $cat->persist(); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/178866-trying-to-move-a-data-import-script-from-one-website-to-another/ Share on other sites More sharing options...
Mark Baker Posted October 24, 2009 Share Posted October 24, 2009 Different versions of PHP on the two servers Change each function call that passes values by reference from addTopCategory(&$topCatIds, '1D', 'Decks'); to addTopCategory($topCatIds, '1D', 'Decks'); and change function addTopCategory($topCatIds, $ess_id, $name){ to function addTopCategory(&$topCatIds, $ess_id, $name){ Quote Link to comment https://forums.phpfreaks.com/topic/178866-trying-to-move-a-data-import-script-from-one-website-to-another/#findComment-943657 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.