May 31, 2013

Can I select a update from database field

Ramin Rahimi’s Question:

What I am trying to do is to select a update from a portion of my site where users upload pictures and I know I have to create a field for that in my database but first I was wondering to know if I can use this syntax like:

SELECT UPDATE 
FROM photos 
WHERE album LIKE BINARY 'loggedin_avatar'  
ORDER BY datemade ASC

so is this a right syntax? also where can I learn about filtering the files being uploaded to my site. Generally filtering the files being uploaded.

No, that is not the correct syntax. SELECT and UPDATE are two different query statements.

If you trying to select a field called update from your database table, then you have to quote them

SELECT `update` FROM photos WHERE album LIKE BINARY 'loggedin_avatar' ORDER BY datemade ASC"; 

If you are trying to select a updated row after updating them, you have to send mulitple statements.

  • First update the rows
  • Select the updated row which the help of a primary key field.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!