13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Next<br />

241<br />

Table 9.10<br />

TEXT <strong>and</strong> BLOB Types<br />

Type Maximum Length (Characters) Description<br />

TINYBLOB 2 8 –1 (that is, 255) A tiny binary large object<br />

(BLOB) field<br />

TINYTEXT 2 8 –1 (that is, 255) A tiny TEXT field<br />

BLOB 2 16 –1 (that is, 65,535) A normal-sized BLOB field<br />

TEXT 2 16 –1 (that is, 65,535) A normal-sized TEXT field<br />

MEDIUMBLOB 2 24 –1 (that is, 16,777,215) A medium-sized BLOB field<br />

MEDIUMTEXT 2 24 –1 (that is, 16,777,215) A medium-sized TEXT field<br />

LONGBLOB 2 32 –1 (that is, 4,294,967,295) A long BLOB field<br />

LONGTEXT 2 32 –1 (that is, 4,294,967,295) A long TEXT field<br />

Table 9.11 shows the ENUM <strong>and</strong> SET types.<br />

Table 9.11<br />

ENUM <strong>and</strong> SET Types<br />

Type Maximum Description<br />

Values in Set<br />

ENUM(‘value1’, 65,535 Columns of this type can hold only one<br />

‘value2’,...)<br />

of the values listed or NULL.<br />

SET(‘value1’, 64 Columns of this type can hold a set of the<br />

‘value2’,...)<br />

specified values or NULL.<br />

Further Reading<br />

For more information, you can read about setting up a database in the <strong>MySQL</strong> online<br />

manual at http://www.mysql.com/.<br />

Next<br />

Now that you know how to create users, databases, <strong>and</strong> tables, you can concentrate on<br />

interacting with the database. In the next chapter, we look at how to put data in the<br />

tables, how to update <strong>and</strong> delete it, <strong>and</strong> how to query the database.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!