Use the IS
operator to compare with NULL
update your_table
set some_field = 'some value'
where some_field is not null
Using = NULL
will not work since comparing with null
results in unknown which is not TRUE
.
More Related Contents:
- Save the data into a database and return another value from database using PHP
- Math Symbol From Mysql To HTML? [closed]
- Create the timestamp of an hour ago [duplicate]
- How to convert the json image url string into Bitmap image to display images in android application
- How to check if a row exists in MySQL? (i.e. check if username or email exists in MySQL)
- How to use multiple databases in Laravel
- How to store repeating dates keeping in mind Daylight Savings Time
- Using a .php file to generate a MySQL dump
- Insert Blobs in MySql databases with php
- Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in [duplicate]
- PDO with INSERT INTO through prepared statements [closed]
- How do I execute PHP that is stored in a MySQL database?
- MySQL returns only one row
- Populate a Drop down box from a mySQL table in PHP
- Error while sending QUERY packet
- How to sort rows of HTML table that are called from MySQL
- Doing a while / loop to get 10 random results
- PDO fetch one column from table into 1-dimensional array
- php file upload, how to restrict file upload type
- Get all mysql selected rows into an array
- Select from mysql table WHERE field=’$array’?
- Warning: mysql_num_rows() expects parameter 1 to be resource, object given [duplicate]
- MySQL error when inserting data containing apostrophes (single quotes)?
- php password_verify() hash and pass won’t match
- MySQL query using an array [duplicate]
- Using MySQL’s TIMESTAMP vs storing timestamps directly
- Which is fastest in PHP- MySQL or MySQLi?
- Is mysql_real_escape_string enough to Anti SQL Injection?
- How to make mysqli connect function?
- Using PHP to upload file and add the path to MySQL database