Re: MySQL, PHP or ghost?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Peter Beckman,

> Seems that either I don't understand mysql, or something.
> 
> My table, with the non-important things removed...
> 
>     mysql> explain plate;
>     +---------+-----------------------+------+-----+---------------------+----------------+
>     | Field   | Type                  | Null | Key | Default             | Extra          |
>     +---------+-----------------------+------+-----+---------------------+----------------+
>     | pid     | mediumint(8) unsigned |      | PRI | NULL                | auto_increment |
>     | year    | year(4)               | YES  |     | NULL                |                |
>     [...]
> 

>     mysql> select * from plate where pid=65;
>     +-----+---------+------+-
>     | pid | plate   | year |
>     +-----+---------+------+-
>     |  65 | DVF0343 | NULL |
>     +-----+---------+------+-
> 
> But if I do this:
> 
>     mysql> update plate set year="" where pid=65;
>     Query OK, 1 row affected (0.01 sec)
>     Rows matched: 1  Changed: 1  Warnings: 1
> 
>     mysql> select * from plate where pid=65;
>     +-----+---------+------+-
>     | pid | plate   | year |
>     +-----+---------+------+-
>     |  65 | DVF0343 | 2000 |
>     +-----+---------+------+-
> 

you have chosen a wrong format. The format for year is 0000. With string
the field years don't know what to do.

Regards,
Ruprecht


-----------------------------------------------
Ruprecht Helms IT-Service & Softwareentwicklung

Tel./Fax +49[0]7621 16 99 16
Homepage: http://www.rheyn.de
email:    info@rheyn.de

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux