[PHP-DB] Re: [PHP] Usiing FOREACH to loop through Array

2002-06-29 Thread Brad Melendy
Steve, Thanks a ton! I'm now running slick as a whistle using your option #1 (looping through the results in the function) and using the newer mysql_fetch_assoc() function. I have a much better understanding of this now and I really appreciate your help. Hopefully I'll get a chance to help some

[PHP-DB] Re: [PHP] Usiing FOREACH to loop through Array

2002-06-29 Thread Brad Melendy
Steve, Thanks very much. This make total sense to me. Now, I was pretty sure that I was getting an array back from mysql_fetch_array because when I do a 'print $myCourses' without specifying any value, I just get 'array' which I believe I am supposed to, IF it is truly an array. Anyway, I'm goi

[PHP-DB] Re: [PHP] Usiing FOREACH to loop through Array

2002-06-29 Thread Steve Edberg
Oops! It's hot, it's Saturday, brain not functioning at 100%, made cut'n'paste error: or (2) set a flag in getCourses() so that the query is only executed once, otherwise returning a result line - something like: function getCourses($UID) global $link; static $result = false;

[PHP-DB] Re: [PHP] Usiing FOREACH to loop through Array

2002-06-29 Thread Steve Edberg
At 3:27 PM -0700 6/29/02, Brad Melendy wrote: >Hi All, >I've stumped myself here. In a nutshell, I have a function that returns my >array based on a SQL query and here's the code: > >-begin code--- >function getCourses($UID) > { > global $link; > $result = mysql_que