- Forums
- MYSQL
- How To insert NULL Data Into MySQL field
This Page Contains information about How To insert NULL Data Into MySQL field By Webune Support in category MYSQL with 0 Replies. [2303], Last Updated: Mon Jun 24, 2024
Webune Support
Thu Oct 08, 2009
0 Comments
610 Visits
hello and welcome to webune web hosting support forums. we provide the best web hosting support by providing tutorials to help you get your website running smoothly.
so if you are asking yourself this questin: "how to update mysql database table field where is null?
lets say for example, you want to update a field in your mysql table where the active field is NULL
you tried to update each row where the active field is NULL and you send this query:
$sql = "UPDATE myusers SET username = 'NoNameProvided' WHERE active = 'NULL'";
so after you send this query, you noticed that it didnt update the rows where the active field is NULL.
here is how you shoul do your query:
$sql = "UPDATE myusers SET username = 'NoNameProvided' WHERE active IS NULL";
now your query will update all the rows' field name 'username' to NoNameProvided where the active field is NULL
hope that helps - If you have any other questions, please free to ask.
Webune Support Team