PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$username_area_id=$_SESSION['username_login'];
$result_area_id=mysql_query("SELECT helpdesk_areas.id, helpdesk_areas.aname FROM helpdesk_users, helpdesk_areas2users, helpdesk_areas WHERE helpdesk_users.username='$username_area_id' AND helpdesk_users.id=helpdesk_areas2users.user_id AND helpdesk_areas2users.area_id=helpdesk_areas.id");
$num_area_id=mysql_numrows($result_area_id);
$i_area_id=0;
$array_area_info = array();
while ($i_area_id < $num_area_id) {
$temp_area_id = mysql_result($result_area_id,$i_area_id,"helpdesk_areas.id");
$temp_area_aname = mysql_result($result_area_id,$i_area_id,"helpdesk_areas.aname");
$array_area_info = array($i_area_id => array("id" => "$temp_area_id","aname" => "$temp_area_aname"));
$i_area_id++;
}
I cant seem to get the array to remember the previous while loops. Does anyone have any idea on a better way for me to do this? The only problem I'm having is the data seems to be added to the array, then the array id counts up on the next while loop and the previous data is gone. grrr
Last edited by Crew on Fri Sep 02, 2005 11:33 am, edited 1 time in total.
Don't you just hate it when you've spent 2 hours fiddling and its that simple. Thanks a lot guys its much appreciated. And I can't believe how quick that was lol.
a lot of the time you concentrate on the specifics of the code and the problem is WHAM right in your face
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.