<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Question2Answer Q&amp;A - Recent questions tagged alter-column</title>
<link>https://www.question2answer.org/qa/tag/alter-column</link>
<description>Powered by Question2Answer</description>
<item>
<title>Add column if not exists</title>
<link>https://www.question2answer.org/qa/19041/add-column-if-not-exists</link>
<description>

&lt;p&gt;
	Trying to add column with below function and when we going to plugin page it is adding column properly but than after that when visit plugin page taking long time and loads nothing.&lt;/p&gt;


&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;function init_queries($tableslc){&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;$table = qa_db_add_table_prefix('users');&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;$col = &quot;SELECT checking FROM &quot;.$table;&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;if(!in_array($col, $tableslc)){&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;$insert_col = &quot;ALTER TABLE &quot;.$table.&quot; ADD checking DATETIME NOT NULL&quot;;&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;qa_db_query_sub($insert_col);&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;


&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;</description>
<category>Plugins</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/19041/add-column-if-not-exists</guid>
<pubDate>Thu, 08 Nov 2012 11:13:21 +0000</pubDate>
</item>
</channel>
</rss>