RE: [PHP-DB] inserting array into mySQL
| From: | Rick Emery | Date: | Fri, 09 Nov 2001 13:30:15 +0000 |
| Subject: | RE: [PHP-DB] inserting array into mySQL | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-14177@lists.php.net to get a copy of this message | ||
mySQL does not directly support arrays. I'm going to assume that there is a
relationship between entries in each array to entries in the other arrays.
Therefore, create mysql records which reflect that relationship. Something
like:
CREATE TABLE people (
name varchar(50) NOT NULL default "",
phone char(12) default "000-000-0000",
street1 char(25) default "",
street2 char(25) default "",
city char(25) default "",
state char(2) default "TX",
zip char(10) default "00000-0000"
)
Be advised, the state filed may be silently changed to 4 characters.
Second, I suggest Texas as the default state, because why not go with the
best. As we say here in Dallas: there are two kinds of people...those who
live in Texas...and those who wish they did.
-----Original Message-----
From: Timothy Potter [mailto:tpotter@tampabay.rr.com]
Sent: Thursday, November 08, 2001 8:36 PM
To: php-db@lists.php.net
Subject: [PHP-DB] inserting array into mySQL
I have an array coming from a form that I need to insert into mySQL.
example: name[], phone[], address[]
Please help?
--
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