Hi All, I keep my emails in my database which are fetched using php_imap. At the minute they are put onto the db using my 1&1 account and this poses no problem.
I am however moving away from the 1&1 account to localhost so that I can eventually downgrade my 1&1 account. The inbox looks like this.
[CODE]+————-+——————+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+————-+——————+——+—–+———+—————-+
| message_id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| header | text | YES | | NULL | |
| header_info | text | YES | | NULL | |
| structure | text | YES | | NULL | |
| from_name | varchar(100) | NO | | NULL | |
| from_email | varchar(255) | NO | MUL | NULL | |
| tel | varchar(50) | YES | | NULL | |
| time | datetime | NO | | NULL | |
| subject | varchar(255) | YES | | NULL | |
| text | longtext | NO | MUL | NULL | |
| html | longtext | YES | MUL | NULL | |
| attachments | longtext | YES | | NULL | |
| read | enum(‘y’,’n’) | NO | | n | |
| downloaded | enum(‘y’,’n’) | NO | | n | |
| follow_up | enum(‘y’,’n’) | NO | | y | |
| replied | datetime | YES | | NULL | |
+————-+——————+——+—–+———+—————-+
I should mention that the `tel
The INSERT looks like this
[code=php]sprintf(“INSERT INTO `inbox` SET `structure` = ‘%s’, `header` = ‘%s’, `header_info` = ‘%s’, `text` = ‘%s’, `html` = ‘%s’, `attachments` = ‘%s’, `from_email` = ‘%s’, `from_name` = ‘%s’, `subject` = ‘%s’, `time` = DATE_SUB(FROM_UNIXTIME(%u), INTERVAL 1 HOUR);”,
mysql_real_escape_string($s_structure),
mysql_real_escape_string($s_header),
mysql_real_escape_string($s_header_info),
mysql_real_escape_string(TEXT),
mysql_real_escape_string(HTML),
mysql_real_escape_string($atts),
mysql_real_escape_string($from_email),
mysql_real_escape_string($from_name),
mysql_real_escape_string($subject),
mysql_real_escape_string($header_info->udate));
The result INSERT when echoed comes out as
[URL=”http://www.forcesresources.co.uk/mysql_dump.php”]http://www.forcesresources.co.uk/mysql_dump.php
This bring up the MYSQL Server has gone away error.
The file is only 761 Kb and so I cannot see a problem as files fit into the 1&1 database and the structure has been taken from a mysql_dump.
The insert works fine without base64 file attachments.
Any suggestions welcome as I am by no means an expert on MYSQL;
Thanks in advance
John Evans