Loading a variable with content from a database
Posted: Sat Oct 21, 2006 8:57 am
Hello,
I need to write a PHP script capable of doing the following:
- Grab information from a database and load it into an array (I think).
- All information that is going to be grabbed are going to be numbers.
- I then need to use in_array to check if the array containing the values from the database match a number in the script.
I'm not exactly sure about how I should go about loading information from a database into an array, the database structure will have one field named 'date', this will contain the number I want to extract. It will have another field named month. I need it to grab all the dates that correspond to any given month (say, january). Doing that alone isn't a big problem, I can make it output, but I can't make it load into a variable.
Any help is appreciated.
Jeff
I need to write a PHP script capable of doing the following:
- Grab information from a database and load it into an array (I think).
- All information that is going to be grabbed are going to be numbers.
- I then need to use in_array to check if the array containing the values from the database match a number in the script.
I'm not exactly sure about how I should go about loading information from a database into an array, the database structure will have one field named 'date', this will contain the number I want to extract. It will have another field named month. I need it to grab all the dates that correspond to any given month (say, january). Doing that alone isn't a big problem, I can make it output, but I can't make it load into a variable.
Any help is appreciated.
Jeff