Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Sunday, October 18, 2026
About Us
O nás
Magazine
Magazín
Open Source
Otvorený softvér
CVS
CVS
Services
Služby
Index  »  Projects  »  phpMyEdit  »  Forum  »  Working with "Null" fields

phpMyEdit General     Working with "Null" fields
Post new topic   Reply to topic    
 
daviddelmonte     Joined: 10 Apr 2010   Posts: 15  
Post Posted: 2010-05-18 11:40
Back to top  Reply with quote     

I have some records where the field contains nothing (NULL).

I want to be able to change the contents of these fields.

When I select a record to update, the fields with "NULL" do not appear in the edit window.

How do I fix this?

Thanks as usual..

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2010-05-19 14:21
Back to top  Reply with quote     

Perhaps I misunderstand the question. I would not expect NULL to be displayed in List or Change mode, or any other mode. If the display of NULL is your objective, use your text editor to search for null in the class file and modify the class file in some way. Or search the forum for null in order to locate other suggestions. Personally, I would refrain from using NULL except in the case of DATE type fields (no point to inserting NULL values when an empty value saves space).

Code:
$opts['fdd']['date_of_sale'] = array(
  'default'    => '',
  'input'      => '',
  'maxlen'     => 10,
  'name'       => 'Date',
  'options'    => 'ACPVDFL',
  'select'     => 'N',
  'size'       => 10,
  'sqlw'       => 'IF($val_qas = "", NULL, $val_qas)',
  'sort'       => true
);


 
daviddelmonte     Joined: 10 Apr 2010   Posts: 15  
Post Posted: 2010-05-19 15:08
Back to top  Reply with quote     

Good advice. Thanks Doug.

Now I have to write a script to change all values of "NULL" to something else useful.

This was a leftover (hangover!) from moving the database from FileMaker to mySQL....grrh

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2010-05-19 15:20
Back to top  Reply with quote     

First, make a copy of the table using phpMyAdmin and alter the field definition. Different field types will behave differently. Work in the copy, using phpMyAdmin, removing NULL definitions in the table schema and leaving the default setting empty. Then browse the records. Date fields might then display 0000-00-00 instead of NULL. Varchar fields might still contain NULL in which case you can drop a query in the SQL box to update them.

I use phpMyAdmin all the time and saved "frequently used clips" in a text file, for possible future use on tables which I frequently need to modify by hand.

SQL query examples include:


Code:
DELETE FROM vs_sys_msg WHERE source_ = "closeout";
DELETE FROM vs_sys_msg WHERE source_ = "contact" AND LEFT(text_, 5) = "Array";
DELETE FROM vs_sys_msg WHERE source_ = "contact";
DELETE FROM vs_sys_msg WHERE source_ = "contact_err";
DELETE FROM vs_sys_msg WHERE source_ = "login";
DELETE FROM vs_sys_msg WHERE source_ = "logout";
DELETE FROM vs_sys_msg WHERE source_ = "php_errormsg";
OPTIMIZE vs_sys_msg;
SELECT id, forum_id, link, thread_id, thread_pos, hidden FROM vs_content WHERE forum_id = 200 ORDER BY forum_id, thread_id, thread_pos
SELECT id, link, body_arg, forum_id, thread_id, thread_pos, hidden FROM vs_content WHERE body_arg > "" ORDER BY forum_id, thread_id, thread_pos;
SELECT id, link, content_css, forum_id, thread_id, thread_pos, hidden FROM vs_content WHERE content_css > "" ORDER BY forum_id, thread_id, thread_pos;
SELECT id, link, css_inc, forum_id, thread_id, thread_pos, hidden FROM vs_content WHERE css_inc > "" ORDER BY forum_id, thread_id, thread_pos;
SELECT id, link, forum_id, thread_id, parent_id, thread_pos, hidden FROM vs_content WHERE forum_id = 1 ORDER BY forum_id, thread_id, thread_pos;
SELECT id, link, forum_id, thread_id, parent_id, thread_pos, ul, hidden, deleted FROM vs_content WHERE forum_id = 1 ORDER BY forum_id, thread_id, thread_pos
SELECT id, link, forum_id, thread_id, parent_id, thread_pos, ul, hidden, deleted FROM vs_content WHERE forum_id = 220 and thread_id = 10 ORDER BY forum_id, thread_id, thread_pos
SELECT id, link, forum_id, thread_id, parent_id, thread_pos, ul, hidden, deleted FROM vs_content WHERE forum_id = 220 and thread_id = 20 ORDER BY forum_id, thread_id, thread_pos
SELECT id, link, js_inc, forum_id, thread_id, thread_pos, hidden FROM vs_content WHERE js_inc > "" ORDER BY forum_id, thread_id, thread_pos;
SELECT id, link, php_inc, forum_id, thread_id, thread_pos, hidden FROM vs_content WHERE php_inc > "" ORDER BY forum_id, thread_id, thread_pos;
SELECT id, link, php_script, forum_id, thread_id, thread_pos, hidden FROM vs_content WHERE php_script > "" ORDER BY forum_id, thread_id, thread_pos;
SELECT link, heading, content_css FROM `vs_content` WHERE forum_id > 200;
TRUNCATE vs_change_log;
TRUNCATE vs_sys_msg;
TRUNCATE vs_user_log;
TRUNCATE wab;
UPDATE  vs_content SET changefreq = 'never' WHERE forum_id > '199';
UPDATE  vs_content SET content_css = 'class="webmaster"' WHERE forum_id = '200';
UPDATE  vs_content SET content_css = 'class="webmaster"' WHERE forum_id = '220';
UPDATE  vs_content SET content_css = 'class="webmaster"' WHERE forum_id > '200';
UPDATE  vs_content SET css_inc = 'style/style.pme11px.css' WHERE forum_id = '200';
UPDATE  vs_content SET css_inc = 'style/style.pme11px.css' WHERE forum_id >= '200';
UPDATE  vs_content SET css_inc = 'style/style2.css' WHERE forum_id = '6';
UPDATE  vs_content SET html_1 = '' WHERE forum_id = '6';
UPDATE  vs_content SET php_inc = 'flash/fid-6.inc' WHERE forum_id = '6';
UPDATE  vs_content SET priority   = '0.0' WHERE forum_id > '199';
UPDATE  vs_content SET spider     = '0' WHERE forum_id > '199';
UPDATE vs_content SET css_inc = 'style/style.pme.css' WHERE forum_id = '255' AND mli = "1";
UPDATE vs_content SET css_inc = REPLACE(css_inc, './style/style.pme.css', 'style/style.pme.css');
UPDATE vs_content SET css_inc = REPLACE(css_inc, 'style/style.pme.css', './style/style.pme.css') WHERE css_inc = 'style/style.pme.css';
UPDATE vs_content SET deleted = '1' WHERE forum_id = '1';
update vs_content set forum_id = 100 where forum_id = 200
update vs_content set forum_id = 200 where forum_id = 255
update vs_content set forum_id = 220, thread_id = thread_id - 20 where forum_id = 200 and (thread_id = 30 or thread_id = 40 or thread_id = 50)
update vs_content set id = 13 where id = 44;
update vs_content set id = 44 where id = 999;
update vs_content set id = 999 where id = 13;
update vs_content set parent_id = 11 where forum_id = 220 and thread_pos > 0 AND thread_id = 10
update vs_content set parent_id = 13 where forum_id = 220 and thread_pos > 0 AND thread_id = 20
update vs_content set parent_id = 44 where forum_id = 220 and thread_pos > 0 AND thread_id = 20
update vs_content set parent_id = 9 where forum_id = 100 and thread_pos > 0 AND thread_id > 20
UPDATE vs_content SET posted_on = NOW();
UPDATE vs_content SET priority = '0.0' WHERE forum_id = '255' AND priority <> '0.0';
UPDATE vs_content SET td_left = '0' WHERE forum_id < '254';
UPDATE vs_content SET thread_id = thread_id * 10;
UPDATE vs_content SET thread_id = thread_id + 1 WHERE forum_id = "200" AND thread_id = "3";
UPDATE vs_content SET thread_id = thread_id + 1 WHERE forum_id = "200" AND thread_id = "4";
UPDATE vs_content SET thread_id = thread_id + 1 WHERE forum_id = "200" AND thread_id = "5";
UPDATE vs_content SET thread_id = thread_id + 5 WHERE forum_id = "200" AND thread_id = "10";
UPDATE vs_content SET thread_pos = '3' WHERE id = "23" LIMIT 1;
UPDATE vs_content SET thread_pos = "9" WHERE id = "22" AND thread_pos = "18";
UPDATE vs_content SET thread_pos = (thread_pos - 4) WHERE forum_id = "220" AND thread_id = "10" AND thread_pos > 11;
UPDATE vs_content SET thread_pos = (thread_pos * 5) WHERE thread_pos > "0" AND forum_id = "6" AND thread_id = "10";
UPDATE vs_content SET thread_pos = 9 WHERE id = 20000 LIMIT 1
UPDATE vs_content SET thread_pos = thread_pos - 1 WHERE forum_id = "200" AND thread_id = "40" AND thread_pos > "0";
UPDATE vs_content SET thread_pos = thread_pos - 1 WHERE forum_id = "200" AND thread_id = "50" AND thread_pos > "0";
UPDATE vs_content SET thread_pos = thread_pos + 1 WHERE forum_id = "255" AND thread_id = "30";
update vs_content set ul = 9 where forum_id = 220
UPDATE xtest SET thread_id = thread_id * 10;


 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Odkazový formulár · Application form · Prihláška
Report bug on PLATON.SK website · Upozorniť na chybu na PLATON.SK webstránke · Terms of use · Podmienky použitia · Privacy policy · Ochrana osobných údajov