Merging 2 MySQL tables with PHP – update one table’s field with another table’s field data (both table have one common field)

Posted by Shek on October 4, 2009 under PHP | Read the First Comment

In this post, I am going to show you how to merge 2 MySQL tables with PHP. Here we have 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:

Read more of this article »

Use PHP to change MySQL field size

Posted by Shek on June 15, 2009 under PHP | Be the First to Comment

In this example, I am going to show you how to use PHP to change a MySQL database’s field size.

Read more of this article »

Change the MySQL database table encoding to UTF8 with PHP

Posted by Shek on June 10, 2009 under PHP | Be the First to Comment

Editor’s note: In some cases, when you have forgotten to preset the MySQL database table encoding to UTF8 after the creation of the database but later you need to insert some UTF8 text such as Chinese or other Asian languages, here is how you could do with PHP to change the encoding of the MySQL database table.

Read more of this article »

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

Posted by Shek on December 28, 2008 under PHP | Read the First Comment

Array is a good way to store many elements, in some operations you might like to store all of the array elements into different row 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. This example, I go show you to insert into different fields.
Read more of this article »

Join all elements of an array together and become a string

Posted by Shek on under PHP | Be the First to Comment

There are many elements in an array. In some operations, you might like to join all the elements within an array to become a string and use the string for other operation, how can this be done?? There is a function of PHP can do the job, which is implode( ). Let me show how to do so:
Read more of this article »

Refresh page with PHP function header()

Posted by Shek on December 25, 2008 under PHP | Be the First to Comment

Editor’s note: In my past post Redirect page using PHP function header(), I talked about how to redirect page with header() function. To refresh a page, by using the same function and redirect to the page to itself, then it has the refresh effect.

Read more of this article »

Page 10 of 18« First...89101112...Last »