Re: [PHP] Mysql adding extra fields.

2002-03-28 Thread hugh danaher

Try,

[type] can be int or char () or blob or real or something else drawn
from the mysql manual

$query="ALTER table_name ADD column_name [type] AFTER other_column_name";
$result=mysql_query($query);
if (!$result) die("couldn't alter table".mysql_error());

Hope this helps,
Hugh


- Original Message -
From: "David Duong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 28, 2002 9:33 PM
Subject: [PHP] Mysql adding extra fields.


> How do I add extra fields after it has already been set?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mysql adding extra fields.

2002-03-28 Thread Miguel Cruz

On Thu, 28 Mar 2002, David Duong wrote:
> How do I add extra fields after it has already been set?

1) Read the manual conveniently available at http://www.mysql.org; this 
is not rocket science.

2) ALTER TABLE mytable ADD boogers_per_hour INT;

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php