whiteboikyle Posted July 1, 2008 Share Posted July 1, 2008 Okay well i am going to do a function that looks in the database.. like so function function_userlevel($userlevel){ global $config; $result = $config->query("SELECT * FROM userlevel where userlevel = '$userlevel'"); } Now see how i did select * from userlevel.. Well the query will come up with with somewhere between 5-10 results.. so how do i do a return $results.. but i need all the results.. so when i use this function it will list all of them. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 1, 2008 Share Posted July 1, 2008 return $results; Then handle it. And don't use global data. Ever. Thanks. Quote Link to comment Share on other sites More sharing options...
papaface Posted July 1, 2008 Share Posted July 1, 2008 Maybe: function function_userlevel($userlevel){ global $config; return $result = $config->query("SELECT * FROM userlevel where userlevel = '$userlevel'"); } Then loop through the array. Quote Link to comment Share on other sites More sharing options...
whiteboikyle Posted July 1, 2008 Author Share Posted July 1, 2008 Maybe: function function_userlevel($userlevel){ global $config; return $result = $config->query("SELECT * FROM userlevel where userlevel = '$userlevel'"); } Then loop through the array. how come dont user global? how else would i get data from my config file.. lol Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 1, 2008 Share Posted July 1, 2008 Pass it through the function call. Quote Link to comment 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.