Information Computer

Monday, August 8, 2011

Mysql Functions In PHP

Earlier we know that PHP has a good connectivity to multiple databases. one of them with MySQL. because in PHP has several functions that are used to MySQL. The following functions.

mysql_connect (Host, Username, Password)
used to connect MySQL database with PHP files.
example : $var = mysql_connect("localhost","root","password").

mysql_close (variable_open_mysql)
used to close the MySQL database connection with PHP files.
example : mysql_close($var).

mysql_select_db(database name)
used to select the database that is used.
example : mysql_select_db("database").

mysql_query(query)
used to run a query.
example : $q = mysql_query("select * from data").

mysql_num_row(variable_query)
used to determine the number of rows in the result of a query.
example : $row = mysql_num_row($q).

mysql_fetch_array(query)
used to display the results of a query in the form of an array.
example : $result = mysql_fetch_array($q).

This new course may be necessary to be submitted. actually there are still others that I have not convey. therefore when the time comes I will update this article. thank :)

need to know! 
In computer science, a subroutine (also called procedure, function, routine, method, or subprogram) is a portion of code within a larger program that performs a specific task and is relatively independent of the remaining code.

As the name "subprogram" suggests, a subroutine behaves in much the same way as a computer program that is used as one step in a larger program or another subprogram. A subroutine is often coded so that it can be started ("called") several times and/or from several places during a single execution of the program, including from other subroutines, and then branch back (return) to the next instruction after the "call" once the subroutine's task is done.

Subroutines are a powerful programming tool, and the syntax of many programming languages includes support for writing and using them. Judicious use of subroutines (for example, through the structured programming approach) will often substantially reduce the cost of developing and maintaining a large program, while increasing its quality and reliability. Subroutines, often collected into libraries, are an important mechanism for sharing and trading software. The discipline of object-oriented programming is based on objects and methods (which are subroutines attached to these objects or object classes).

In the compilation technique called threaded code, the executable program is basically a sequence of subroutine calls. Maurice Wilkes, David Wheeler, and Stanley Gill are credited with the invention of this concept, which they referred to as closed subroutine

Related Posts



Followers