View Single Post
  #2 (permalink)  
Old 04-29-2008, 05:39 PM
John's Avatar   
John John is online now
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,255
Last Blog:
Passwords
Credits: 914
Rep Power: 20
John has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud of
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.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Reply With Quote