<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — How to use ""ALTER TABLE" and add a column?]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5155&amp;type=atom" />
	<updated>2014-09-18T03:33:39Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=5155</id>
		<entry>
			<title type="html"><![CDATA[Re: How to use ""ALTER TABLE" and add a column?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=20841#p20841" />
			<content type="html"><![CDATA[<p>$cust_id should be a string with the name of the field and not it&#039;s value. If it is a reserved keyword then backquote it.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-09-18T03:33:39Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=20841#p20841</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to use ""ALTER TABLE" and add a column?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=20776#p20776" />
			<content type="html"><![CDATA[<p>the query worked, and it created a column. but it immediately executed the &quot; ROLLBACK&quot; query, than it will be reveresed.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2014-09-12T10:02:39Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=20776#p20776</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to use ""ALTER TABLE" and add a column?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=20775#p20775" />
			<content type="html"><![CDATA[<p>Thanks both of you. <br /> Barbarian, i tried the code with PHPmyadmin. it works fine there. </p><p>Cambell,&nbsp; Actually the user is default user in phpmyadmin. </p><p>the query is not working with the TR_PREF and $Cust_id. while using the above code.&nbsp; And my query failed to work. </p><p>And i tried to show the sql queries by enabling the option on config.php.&nbsp; but it showed &quot; ROLLBACK&quot; </p><p>What is the issue in it.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2014-09-12T09:54:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=20775#p20775</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to use ""ALTER TABLE" and add a column?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=20764#p20764" />
			<content type="html"><![CDATA[<p>you can print the sql query with the confir set to true and just run it in the phpmyadmin to see which part of the query has something wrong</p>]]></content>
			<author>
				<name><![CDATA[barbarian]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18954</uri>
			</author>
			<updated>2014-09-11T12:15:22Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=20764#p20764</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to use ""ALTER TABLE" and add a column?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=20763#p20763" />
			<content type="html"><![CDATA[<p>A couple of things</p><p>Is the table name really hard coded to be TB_PREFtable_name?&nbsp; Or is table_name a variable in which case it should be $table_name.&nbsp; It would make more sense to me for the column name you are adding to be a constant e.g. &#039;some_column&#039; rather than a variable.</p><p>Does the database user have permission to alter table structure?&nbsp; Most likely does worth checking though.</p><p>Check the syntax against this:</p><p>http://dev.mysql.com/doc/refman/5.1/en/alter-table.html<br />http://dev.mysql.com/doc/refman/5.1/en/create-table.html</p><p>You can also get good help on sql here:</p><p>http://stackoverflow.com/</p><p>ALTER TABLE&nbsp; `0_users` ADD&nbsp; `test` INT( 10 ) NOT NULL ;</p>]]></content>
			<author>
				<name><![CDATA[cambell]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19447</uri>
			</author>
			<updated>2014-09-11T10:41:49Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=20763#p20763</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[How to use ""ALTER TABLE" and add a column?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=20762#p20762" />
			<content type="html"><![CDATA[<p>Hi, </p><p>I need to add a column using alter table query. here is the query string i used. but it dooesnot work for me.</p><p>$kv_sql = &quot;ALTER TABLE &quot;.TB_PREF.&quot;table_name ADD &quot;.db_escape($cust_id).&quot; INT(10) NOT NULL&quot; ;&nbsp; </p><p>&nbsp; &nbsp; db_query($kv_sql, &quot;The employee attendance could not be added&quot;); </p><p>But t doesnot work in it.&nbsp; <br /> i dont know the bug.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2014-09-11T09:35:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=20762#p20762</id>
		</entry>
</feed>
