I have updated the example to illustrate one way to upload/download/attach pictures to records.
It is largely based on the original code. I have added the server's responses in the Log. Clicking on "Debug php code" will force the php module to return more complete error info. This would be error messages coming back from the database as long as php does not crash. If php crashes (because of coding errors in the personsdb3.php module), error code pretty much says "php crashed" and you need to be logged into the server to view the error log from apache itself to see what the error was. That can be tedious. On the other hand, detailed error messages can give a lot of information to someone trying to break into your system so it is good practice to remove debug code from final products.
If a record has a picture associated with it, the picture will be displayed when clicking on the record. From my quick testing on my home cable internet access, files <100k show up almost immediately, bigger files (MB region) have an appreciable and annoying delay (my server is not local). YMMV. The example code puts no limit on file size. If such a hard limit was set, it should be in the php code with a warning in the B4J code when selecting a large file.
The way picture files are handled is a little different from other record information:
1) picture files are stored outside the database
2) the database contains the file name and path to the picture (path implementation is incomplete, example works though)
3) pictures are downloaded directly from the server (you have to know the file name and path but if you have those, you do not need to go through the php code to download the picture. That would be a severe privacy issue in any end user application but since this example makes no attempt to validate users, it's a moot point.)
4) when using the Delete Picture button, only the references to the picture in the database is deleted, the actual picture file is not deleted. I leave this as an exercise for the reader. That should be handled in the php code using the unlink() function.
5) All pictures are stored in the same folder. That would be a problem if multiple pictures of the same name are uploaded for different records. There is a forum message above from nwhitfield showing one way to do it. Another way (not user dependent) which I may add to this example later would be to create a folder with a time stamp when the picture is stored. This time stamp can be stored in the database in the pfolder field. Since Unix time stamps have 1mS resolution, you would be unlikely to have two folders with the same time stamp containing two files of the same name. A complete resolution of this issue is left as an exercise for the reader.
Even though this is in the Tutorial section, my knowledge of MySQL and php is definitely not expert level so be gentle in your comments