[PHP] Compile on Mac OS X --with-java?
Has anyone managed to get PHP to compile on Mac OS X with the --with-java flag in the configure command? I've tried it with PHP 4.3.2, 4.3.3, and 4.3.4, all without any luck. I'm using Mac OS X Server 10.2.8, with Java 1.4.1. I've tried ./configure --with-mysql --with-apxs --with-xml --with-java=/Library/Java/Home and ./configure --with-mysql --with-apxs --with-xml --with-java When I run make, it dies with: make: *** [ext/java/java.lo] Error 1 I can build just fine if I configure with: ./configure --with-mysql --with-apxs --with-xml Looking over the output from make, it looks like the trouble starts here: /Users/admin/Desktop/php-4.3.3/ext/java/java.c:39:24: JavaVM/jni.h: No such file or directory The only jni.h files I could find are: /Developer/Java/Headers/vm-jni.h /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Headers/jni.h /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h My knowledge of how Apple set up java gets a bit fuzzy at this point. http://developer.apple.com/documentation/Java/Conceptual/Java131Development/ overview/chapter_2_section_5.html helps a bit, but clearly we're moving beyond just a simple install here. Any ideas? Anybody have success with this? Thanks, Karl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] looping through database results
I'm working on a basic calendar app in PHP, but I've hit a snag. The events are stored in a MySQL database, and the goal is to have the events displayed on the correct day on the calendar. The calendar is generated through a couple of while() statements that loop through the weeks and days. I'm having trouble getting the events from the database match up with the correct days. I think the problem is that I can only loop through the database results once. The code looks something like this (lots of extraneous stuff trimmed): while ($day_of_week <= 6) { while ($event_row = mysql_fetch_array($events)) { $event_day = $event_row["event_day"]; if ($event_day == $day) { $event_name = $event_row["event_name"]; print "$event_name\n"; } } } Since it seems to only loop through the while ($event_row = mysql_fetch_array($events)) statement once (instead of the 30 times I want it to loop through), I figure the issue is that after the one loop, $event_row does indeed equal mysql_fetch_array($events). So I try to unset the $event_row after the loop, but that didn't work. I even tried to make $event_row into a variable variable name. Couldn't get that to work either. I'm running PHP version 4.0.6, if that matters. thanks, Karl (feel free to cc [EMAIL PROTECTED], as I'm on the digest) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] looping through database results
Thanks for your help, Andrew, but it didn't seem to work. As I read the manual (http://www.php.net/manual/en/function.mysql-fetch-array.php), mysql_fetch_array is much like mysql_fetch_row, except that it uses the field names instead of numbers as the array key. Somebody correct me if I'm wrong... Karl Andrew Elliston wrote: > Try using: > > while ($event_row = mysql_fetch_row($events)) > > instead. mysql_fetch_row will grab one row of the result array at a > time, until there are no more rows. This sounds like what you want. What > you were doing was grabbing the entire result array and storing them in > one variable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]