Instead of using textfield to input one line of text, we could use textarea of HTML Form for user to input multiple lines. However if we use PHP to insert the text from textarea into the MySQL database with the same method as the textfield, all of the multiple lines will become 1 line and stored into the database. To solve this issue, we could use a PHP function:
Continue Reading →
Posted by admin
in PHP
No Comments →
In some cases, we have to include PHP variable within a MySQL query, here is how it is done:
Continue Reading →
Posted by admin
in PHP
No Comments →
To merge 2 MySQL tables with PHP, in this case we have an example with 2 MySQL tables, both with 2 fields and 1 field of each are in common. The aim is to update one table’s field with 1 field from the other table. Here are the 2 tables’ structure:
Continue Reading →
Posted by admin
in PHP
No Comments →
In this example, I am going to show you how to use PHP to change a MySQL database’s field size.
I have created a MySQL database with a table called “test” and a field called “testing” size varchar(100).
I have created a PHP file called “changesize.php” and I would like to use it to change the field size from varchar(100) to varchar(200). Continue Reading →
Tags: Alter, Database, Field, MySQL, PHP, Table
Posted by admin
in PHP
No Comments →