Re: PHP command to insert new field
| From: | Cody Caughlan | Date: | Wed, 02 Aug 2000 17:46:10 +0000 |
| Subject: | Re: PHP command to insert new field | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1731@lists.php.net to get a copy of this message | ||
write your own:
function modify_table($database, $table, $column_name, $type )
{
$str = "ALTER TABLE $table ADD column $column_name $type";
mysql_db_query($database, $str);
}
that 'should' work, although I wont promise you. I am not sure if
mysql_db_query has problems with non
INSERT,SELECT,UPDATE,DELETE statements. try it out..
/Cody Caughlan
Dave wrote:
> Hi all,
>
> Is there a php command to add a field to a table (preferably at the end)?
> If not, does anyone have a function that performs it already?
>
> Thanx,
>
> Dave
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Cody Caughlan -codyc@cisco.com- Cisco Systems
Web/Database Engineer phone: (408) 525-6029
Enterprise Line of Business pager: (408) 951-9949