PHPSuperBlog.com

Use PHP to change MySQL field size

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 →

Insert all array elements into MySQL database table’s different fields

Array is a good way to store many elements, but in some operations you might like to store all of the elements in a array into different field of a table in a MySQL database. To store into different row, we can use a for loop to go through each elements and run a query to insert them 1 by 1 but insert into different fields is another story. Let me show you how in this example: Continue Reading →

Display all field (column) names of a table in MySQL database

I mentioned before in my previous post Display data from MySQL with PHP which I demonstrated how to display the data of a row within a table, now I want to demonstrate how to display and print out all field names (column names) of a table within a MySQL database. Continue Reading →

Find the number of column (field) of a table in MySQL database

To find and print out the number of column (field) of a table in MySQL database, we have to use a php function “mysql_num_fields()” to get the number and to use a variable to store the result, here I have created an example to demonstrate how to do so: Continue Reading →

  • Categories

  • Useful Downloads