View Single Post
  #2 (permalink)  
Old 04-29-2008, 05:39 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 5,306
Blog Entries: 24
Rep Power: 20
John is just really niceJohn is just really niceJohn is just really niceJohn is just really niceJohn is just really nice
Send a message via AIM to John Send a message via MSN to John
Default Re: Tutorial: Storing Images in MySQL with PHP / Part II / Display your images

If `id` is always to be an integer, it would be wise to add:
PHP Code:
if(!is_int($id) {
die(
"That image is not valid.");

That way your code is not nearly as vulnerable to SQL injections. I would also add mysql_real_escape_string($id) inside the query too - but not absolutely necessary. Other than that, nice tutorial.
Reply With Quote