I'm using a Mysql database and came across something.
I can insert and select records etc from database with PHP, but i came across this new problem when making a script.
the scenario is = I have a database and table with fields like say
record_id | first_name | last_name | email | comments | date
-----------------------------------------------------------------------------
and say everything is all inserted already except the 'comments' field .
If I want that to be a field that can always be overwritten or to be NULL or inserted at anytime the user wants .
I tried UPDATE php , but i ran into a problem like this
Code: Select all
$query = "UPDATE users SET comments = '" . $comments . "WHERE comments = NULL ";it wouldnt do anything, and i also noticed that even if it had ,it would be inserting that user's comments into ALL the NULL comments fields.
Do you know how i can update or insert into a field that starts as NULL , without affecting other users table columns?
Thank you!