toxictoad Posted November 25, 2008 Share Posted November 25, 2008 Hi, I've got some fields in my database that are empty and using phpMyAdmin I wanted to use the search to pull these records out so I can update them all without having to find each one manually but I can't seem to find out how? I tried using LIKE = IS NULL and other variations but they are empty fields and IS NULL doesn't return them. Is there a way around this, remaining in phpMyAdmin? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/134242-solved-is-null-not-an-option-for-phpmyadmin-search/ Share on other sites More sharing options...
toxictoad Posted November 27, 2008 Author Share Posted November 27, 2008 can anyone help? if not with using the phpMyAdmin search, what about the sql that would pull these records? thanks Quote Link to comment https://forums.phpfreaks.com/topic/134242-solved-is-null-not-an-option-for-phpmyadmin-search/#findComment-700358 Share on other sites More sharing options...
Mchl Posted November 27, 2008 Share Posted November 27, 2008 UPDATE `table` SET `column` = 'Set your value here' WHERE `column` IS NULL UPDATE `table` SET `column` = 'Set your value here' WHERE `column` = '' (for empty strings) Quote Link to comment https://forums.phpfreaks.com/topic/134242-solved-is-null-not-an-option-for-phpmyadmin-search/#findComment-700382 Share on other sites More sharing options...
toxictoad Posted November 27, 2008 Author Share Posted November 27, 2008 Thanks for the reply Mchl. Where you say 'set your value here' what should this be? I tried leaving it blank but it doesn't return anything and yet I don't have a value to enter as the fields are blank? Quote Link to comment https://forums.phpfreaks.com/topic/134242-solved-is-null-not-an-option-for-phpmyadmin-search/#findComment-700513 Share on other sites More sharing options...
toxictoad Posted November 27, 2008 Author Share Posted November 27, 2008 I got it to work using SELECT * FROM `mymovies` WHERE `plot` = '' Thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/134242-solved-is-null-not-an-option-for-phpmyadmin-search/#findComment-700517 Share on other sites More sharing options...
Mchl Posted November 27, 2008 Share Posted November 27, 2008 The queries I posted, should update your empty fields with whatever you put instead of 'set your value here' So if you want all empty fields to be for example '1' do UPDATE `table` SET `column` = '1' WHERE `column` = '' Although from your example it seems that you will want to put different plot for each movie anyways Quote Link to comment https://forums.phpfreaks.com/topic/134242-solved-is-null-not-an-option-for-phpmyadmin-search/#findComment-700519 Share on other sites More sharing options...
toxictoad Posted November 28, 2008 Author Share Posted November 28, 2008 slowly getting an understanding of it (php/mysql) and after a little testing I could see what you'd given me, was just having trouble fitting it in with what I was doing but all good and I now know what I need to update records based using the SET & WHERE clause Thank you Quote Link to comment https://forums.phpfreaks.com/topic/134242-solved-is-null-not-an-option-for-phpmyadmin-search/#findComment-700725 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.