EchoFool Posted March 22, 2010 Share Posted March 22, 2010 Hey, If i return mysql_fetch_assoc($Query); In my function and the call it on my script like this: $array = function(); How would i use the array because i tried $array[0] to echo the first field selected from the query but i get an offset error. So im assuming mysql_fetch_assoc returns an array in a different type ? Quote Link to comment https://forums.phpfreaks.com/topic/196177-array-returns-in-functions/ Share on other sites More sharing options...
Alex Posted March 22, 2010 Share Posted March 22, 2010 mysql_fetch_assoc, as the name suggests, returns an associative array. You might be looking for mysql_fetch_row. Quote Link to comment https://forums.phpfreaks.com/topic/196177-array-returns-in-functions/#findComment-1030217 Share on other sites More sharing options...
EchoFool Posted March 22, 2010 Author Share Posted March 22, 2010 Oh i see - thank you AlexWD Quote Link to comment https://forums.phpfreaks.com/topic/196177-array-returns-in-functions/#findComment-1030228 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.