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

Posted by Shek on November 23, 2008 under PHP | Be the First to Comment

Editor’s note: I mentioned 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 all field names (column names) of a table within a MySQL database.
Read more of this article »

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

Posted by Shek on November 16, 2008 under PHP | Be the First to Comment

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:

Read more of this article »

Check how many record in the MySQL database matches the query

Posted by Shek on June 30, 2008 under PHP | Be the First to Comment

Editor’s note: In some cases, you might like to check how many records in the MySQL database which matches the query you entered. Case such as a login system where you want to check if there is a record matches the user name and the password inputted , here is an example
Read more of this article »

Display UTF8 encoding records such as Chinese or Asian languages from MySQL database with PHP

Posted by Shek on June 23, 2008 under PHP | Be the First to Comment

Editor’s note: If you are a programmer who involves with a database with UTF8 language encoding records such as Chinese or other Asian languages. You might counter some cases when you try to display the records, the UTF8 language characters might appear to be meaningless symbols. I have found a way to solve this issue.
Read more of this article »

Check ip address of host or website with PHP function and HTML form

Posted by Shek on May 26, 2008 under PHP | Be the First to Comment

Editor’s note: There is a function in PHP to check the IP address of a host. It is called “gethostbyname()“. We could use it to check the IP address of a website. Steps are very simple: Put the website address into the function, for example: gethostbyname(www.phpsuperblog.com); and print the result out and then the IP address of the website would appear.
Read more of this article »

Write text into a text file with PHP

Posted by Shek on May 23, 2008 under PHP | Be the First to Comment

Database is to store data for future use, however we could also store string in a text file for future use. The way to do this is very simple, all we have to do is to use the PHP function fwrite() to write the string into the text file. I have created an example here to demonstrate how to do so.
Read more of this article »

Page 2 of 612345...Last »