Found 6702 Articles for Database

How can we create a MySQL table by using PHP script?

Jennifer Nicholas
Updated on 22-Jun-2020 13:28:25

131 Views

As we know that PHP provides us the function named mysql_query to create a MySQL table. To illustrate this we are using the following example −In this example, we are creating a table named ‘Tutorials_tbl’ with the help of PHP script inExample           Creating MySQL Tables                  

Which PHP function is used to create a MySQL table?

Ankitha Reddy
Updated on 30-Jul-2019 22:30:21

77 Views

PHP uses a mysql_query function to create a MySQL table. This function takes two parameters and returns TRUE on success or FALSE on failure. Its syntax is as follows − Syntax bool mysql_query( sql, connection ); Followings are the parameters used in this function − Sr.No Parameter & Description 1 Sql Required - SQL query to create a MySQL table 2 connection Optional - if not specified, then the last opened connection by mysql_connect will be used.

How can we select a MySQL database by using PHP script?

Vrundesha Joshi
Updated on 22-Jun-2020 13:33:45

104 Views

As we know that PHP provides us the function named mysql_select_db to select a mysql database.ExampleTo illustrate this we are selecting a database named ‘Tutorials’ with the help of PHP script in the following example −           Selecting MySQL Database                  

Which PHP function is used to select a MySQL database?

seetha
Updated on 22-Jun-2020 13:33:13

117 Views

PHP uses mysql_select_db function to select a MySQL database. This function takes two parameters and returns TRUE on success or FALSE on failure. Its syntax is as follows −Syntaxbool mysql_select_db( db_name, connection );Followings are the parameters used in this function:Sr.NoParameter & Description1db_nameRequired - MySQL database name to be selected2connectionOptional - if not specified, then the last opened connection by mysql_connect will be used.

Which PHP function is used to delete an existing database?

vanithasree
Updated on 22-Jun-2020 13:21:36

86 Views

PHP uses a mysql_query function to delete a MySQL database. This function takes two parameters and returns TRUE on success or FALSE on failure. Its syntax is as follows −Syntaxbool mysql_query( sql, connection );Followings are the parameters used in this function −Sr. No.Parameter & Description1RequiredSQL query to delete a MySQL database2Optionalif not specified, then the last opened connection by mysql_connect will be used.

How can we create a new database by using PHP script?

Nancy Den
Updated on 22-Jun-2020 13:34:56

79 Views

As we know that PHP provides us the function named mysql_query to create a new database.ExampleTo illustrate this we are creating a database named ‘Tutorials’ with the help of PHP script in the following example −           Creating MySQL Database                  

Which PHP function is used to create a new database?

radhakrishna
Updated on 22-Jun-2020 13:22:24

85 Views

PHP uses mysql_query function to create a MySQL database. This function takes two parameters and returns TRUE on success or FALSE on failure. Its syntax is as follows −Syntaxbool mysql_query( sql, connection );ExampleFollowings are the parameters used in this function −S. No.Parameter & DescriptionSqlRequired - SQL query to create a MySQL databaseconnectionOptional - if not specified, then the last opened connection by mysql_connect will be used.

Write an example to establish MySQL database connection using PHP script?

Krantik Chavan
Updated on 22-Jun-2020 13:22:49

122 Views

We can use following PHP script to make a MySQL database connection having user ‘guest’ and password ‘guest123’.           Connecting MySQL Server                  

Which PHP function is used to disconnect from MySQL database connection?

Daniol Thomas
Updated on 22-Jun-2020 13:24:29

191 Views

PHP provides us mysql_close() function with the help of which we can disconnect from the MySQL database anytime. This function takes a single parameter, which is a connection returned by the mysql_connect() function. Its syntax is as follows −Syntaxbool mysql_close ( resource $link_identifier );Here, if a resource is not specified, then the last opened database is closed. This function returns true if it closes the connection successfully otherwise it returns false.

Which PHP function is used to establish MySQL database connection using PHP script?

mkotla
Updated on 22-Jun-2020 13:23:44

138 Views

PHP provides mysql_connect() function to open a database connection. This function takes five parameters and returns a MySQL link identifier on success or FALSE on failure. Its syntax is as follows −Syntaxconnection mysql_connect(server, user, passwd, new_link, client_flag);Following table give us the parameters used in the syntax above −Sr.NoParameter & Description1ServerOptional − The host name running the database server. If not specified, then the default value will be localhost:33062UserOptional − The username accessing the database. If not specified, then the default will be the name of the user that owns the server process3PasswdOptional − The password of the user accessing the ... Read More

Advertisements