Re: primary field
| From: | JJeffman | Date: | Fri, 16 Feb 2001 22:46:41 +0000 |
| Subject: | Re: primary field | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-6699@lists.php.net to get a copy of this message | ||
No it hasn't. The field order in the form doesn't matter, but the order you
use their values in the query yes !
I don't know what kind of operation you're making on the database
updating, inserting, etc. ).
If you are inserting you must not give any member_id, as long as it is
generated by the database server. As you won't attribute any value to
member_id you must tell which fields you are inserting : "insert into table
(last_name) values('$lastName')" this way you'll get no errors, at least if
last_name is not a unique key .
If you is updating data you can't modify the member_id which is the table
primary key.
HTH.
Jayme.
-----Mensagem Original-----
De: Marc Bragg <msbjustice@mindspring.com>
Para: <php-db@lists.php.net>
Enviada em: sexta-feira, 16 de fevereiro de 2001 17:55
Assunto: [PHP-DB] primary field
> Does the first field in a form have special significance?
> Have two fields in table:
>
> last_name
> member_id
>
> member_id is key and autoincrement.
>
> mysql won't accept two last names as same when last_name is first field.
>
> when member_id is made first field, then can input same last name into
> last_name field.
>
> why is that?
>
>
> --
> 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
>