Coding Critique is the place to post source code for peer review by other members of DevNetwork. Any kind of code can be posted. Code posted does not have to be limited to PHP. All members are invited to contribute constructive criticism with the goal of improving the code. Posted code should include some background information about it and what areas you specifically would like help with.
Popular code excerpts may be moved to "Code Snippets" by the moderators.
matthewcl375 wrote:NOTE: I custom built this app for MY own use and not to be distributed to others - the source code reflects this:
I don't see the source code having any license or restrictions with it. If the code you posted above cannot be used by others, then it would probably be better to remove it from this site. We do not delete old posts, so that code will be available for many years.
The code above is allowed to be copied as it is only a part of my application. I will not be posting the whole code up on these forums.
I suppose i wrote that line a little wrongly. What i meant was that the APPLICATION was not to be distributed. I am not worried about whether this source code gets passed on or not.
I would probably change your query statement to the below snippet or something similar.
I would also add some verification of some sort (Only numbers for the ID/ISBN, Etc, etc)
If I was writing something to manage books I think I'd just get the user to enter the ISBN number (or better yet, buy a cheap barcode scanner and scan it) and then I'd use a web service like isbndb.com or Amazon to fetch the details from the net. Much easier for the user.