How To insert NULL Data Into MySQL field

RegisterLogin
How To insert NULL Data Into MySQL field
Post Description: How To Insert Null Data Into Mysql Field
Tags: How, To, Insert, Null, Data, Into, Mysql, Field
This Post Was Posted On Oct 08, 2009 By Webune Support #2499
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
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2012 Webune Forums - Thu Dec 13, 2012 11:18 pm
Powered by: Webune Forums V3