Click to See Complete Forum and Search --> : Delete and set for NULL


dannybrazil
09-15-2009, 07:42 AM
Hello
after deleting an entry i want to change the field in to NULL(not the string)

i did this :

mysql_query("UPDATE _Form_Nr_2 SET $photo_number='NULL' WHERE id=$id ");

but it seems NOT to work

any help ?

NogDog
09-15-2009, 08:20 AM
No quotes around NULL (it's a keyword, not a string literal). On a side note, do you really want to use the variable $photo_number for the column name, or should it just be photo_number (no "$") as the actual column name?

dannybrazil
09-15-2009, 08:23 AM
the $photo_number is a variable that will change every time the user will delete a specific page so every photo sits in a different column

i'll try and will write back

thanks

dannybrazil
09-15-2009, 08:29 AM
working !

thanks