gravis Posted August 1, 2007 Share Posted August 1, 2007 hi, I have recently outsourced a site and having put it live have found that its outputting a number instead of a county from the database, the numbers are coming from an array that converts each county to a number for storing in the database but doesnt seem to be converting them back to text when outputted, pls help as website has gone live & looks very bad, cant get in touch with freelancer! Quote Link to comment https://forums.phpfreaks.com/topic/62826-solved-outputting-from-array/ Share on other sites More sharing options...
DeadEvil Posted August 1, 2007 Share Posted August 1, 2007 show us the query and how you format it.. Quote Link to comment https://forums.phpfreaks.com/topic/62826-solved-outputting-from-array/#findComment-312750 Share on other sites More sharing options...
gravis Posted August 1, 2007 Author Share Posted August 1, 2007 hope this is what you need not too familiar with php!! if($instituteId == '') { $_SESSION['sessMsg'] = "Invalid Request"; header("location: index.php"); exit(); } else { $sqlSR = " select * from tbl_course where instituteId = '$instituteId' and status = 1 "; $resSR = executeQuery(dopaging($sqlSR,10)); $noOfRows = mysql_num_rows($resSR); } ?> <?php $sqlID = "select * from tbl_institute where instituteId = '$instituteId' "; $resID = executeQuery($sqlID); if($rowID = mysql_fetch_array($resID)){ ?> <?php } }?> <strong>Address</strong>: <br/> <?=$rowID['address']?><br/> <?=$rowID['county']?><br/> Quote Link to comment https://forums.phpfreaks.com/topic/62826-solved-outputting-from-array/#findComment-312751 Share on other sites More sharing options...
gravis Posted August 1, 2007 Author Share Posted August 1, 2007 the array is stored in an include file as the following.. $arrCounty = array( '1'=>"***Republic of Ireland***", '2'=>"Carlow ", '3'=>"Cavan ", '4'=>"Clare ", '5'=>"County Cork ", '6'=>"Cork City", '7'=>"Donegal", '8'=>"County Dublin", '9'=>"South Dublin City", '10'=>"North Dublin City", '11'=>"Dublin City Centre", '12'=>"County Galway ", '13'=>"Galway City", '14'=>"Kerry ", '15'=>"Kildare ", '16'=>"Kilkenny ", '17'=>"Laois ", '18'=>"Leitrim ", '19'=>"Limerick ", '20'=>"Limerick City", '21'=>"Longford ", '22'=>"Louth ", '23'=>"Mayo ", '24'=>"Meath ", '25'=>"Monaghan ", '26'=>"Offaly ", '27'=>"Roscommon ", '28'=>"Sligo ", '29'=>"Tipperary", '30'=>"Waterford ", '31'=>"Westmeath", '32'=>"Athlone ", '33'=>"Wicklow", '34'=>"***Northern Ireland***", '35'=>"Antrim", '36'=>"Belfast City", '37'=>"Armagh", '38'=>"Down", '39'=>"Fermanagh", '40'=>"Londonderry", '41'=>"Tyrone" ); Quote Link to comment https://forums.phpfreaks.com/topic/62826-solved-outputting-from-array/#findComment-312753 Share on other sites More sharing options...
mrjcfreak Posted August 1, 2007 Share Posted August 1, 2007 Try changing <?=$rowID['county']?> to <?=$arrCounty["{$rowID['county']}"] ?> Quote Link to comment https://forums.phpfreaks.com/topic/62826-solved-outputting-from-array/#findComment-312765 Share on other sites More sharing options...
gravis Posted August 1, 2007 Author Share Posted August 1, 2007 I have spent hours on this and was at wits end.. thank you very very much it worked Quote Link to comment https://forums.phpfreaks.com/topic/62826-solved-outputting-from-array/#findComment-312769 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.