1 2 3 4 5 6 > >>   Sort: Rank

Retrieving Execution Error Message in MySQL
How To Get MySQL Statement Execution Errors in MySQL? When you execute a MySQL statement with mysql_query(), and the statement failed, mysql_query() will return the Boolean value FALSE. This is good enough to tell that there is something wrong with that statement. But if you want to know more about ...
2017-10-23, 212👍, 0💬

Execute SQL Statements in MySQL
How To Execute a SQL Statement in MySQL? You can run any types of SQL statements through the mysql_query() function. It takes the SQL statement as a string and returns different types of data depending on the SQL statement type and execution status: Returning FALSE, if the execution failed. Returnin...
2017-10-23, 212👍, 0💬

Selecting an Existing Database in MySQL
How To Select an Exiting Database in MySQL? The first thing after you have created a connection object to the MySQL server is to select the database where your tables are located, by using the mysql_select_db() function. If your MySQL server is offered by your Web hosting company, they will assign a...
2017-10-23, 205👍, 0💬

Deleting an Existing Database in MySQL
How To Drop an Existing Database in MySQL? If want to drop an existing database from the MySQL server, you can use the DROP DATABASE statement. Here is a good example of dropping an existing database: $con = mysql_connect('localhost:8888' ,'dev', 'iyf'); $sql = 'DROP DATABASE fyi'; if (mysql_query($...
2017-10-23, 201👍, 0💬

Selecting Other User's Database in MySQL
Can You Select Someone Else Database in MySQL? If your MySQL server is provided by an Internet service company, they will provide you one database for your use only. There are many other databases on the server for other users. But your user account will have no privilege to select other databases. ...
2017-10-23, 199👍, 0💬

Counting Duplicated Values in a Column in MySQL
How To Count Duplicated Values in a Column in MySQL? If you have a column with duplicated values, and you want to know what are those duplicated values are and how many duplicates are there for each of those values, you can use the GROUP BY ... HAVING clause as shown in the following example. It ret...
2017-10-16, 224👍, 0💬

Apply Filtering Criteria at Group Level in MySQL
How To Apply Filtering Criteria at Group Level in MySQL? If you want to return only specific groups from the query, you can apply filtering criteria at the group level by using the HAVING clause inside the GROUP BY clause. Note group functions can also be used in HAVING conditions. The following tut...
2017-10-16, 218👍, 0💬

Using Multiple Columns in GROUP BY in MySQL
Can Multiple Columns Be Used in GROUP BY in MySQL? If you want to break your output into smaller groups, if you specify multiple column names or expressions in the GROUP BY clause. Output in each group must satisfy a specific combination of the expressions listed in the GROUP BY clause. The more col...
2017-10-16, 213👍, 0💬

Dividing Query Output into Groups in MySQL
How To Divide Query Output into Groups in MySQL? You can divide query output into multiple groups with the GROUP BY clause. It allows you specify a column as the grouping criteria, so that rows with the same value in that column will be considered as a single group. When the GROUP BY clause is speci...
2017-10-16, 208👍, 0💬

Group Functions with Non-group Selections in MySQL
Can Group Functions Be Mixed with Non-group Selection Fields in MySQL? If a group function is used in the SELECT clause, all other selection fields must be group level fields. Non-group fields can not be mixed with group fields in the SELECT clause. The script below gives you an example of invalid S...
2017-10-16, 207👍, 0💬

Managing Tables and Running Queries with PHP for MySQL
Where to find answers to frequently asked questions on Managing Tables and Running Queries with PHP for MySQL? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on Managing Tables and Running Queries with PHP for MySQL. Clear explanations and tutorial ...
2017-10-08, 241👍, 0💬

Inserting Data into an Existing Table in MySQL
How To Insert Data into an Existing Table in MySQL? If you want to insert a row of data into an existing table, you can use the INSERT INTO statement as shown in the following sample script: <?php include "mysql_connection.php"; $sql = "INSERT INTO fyi_links (id, url) VALUES (" . " 101, 'dev....
2017-10-08, 224👍, 0💬

Creating a New Table in MySQL
How To Create a New Table in MySQL? If you want to create a table, you can run the CREATE TABLE statement as shown in the following sample script: <?php include "mysql_connection.php"; $sql = "CREATE TABLE fyi_links (" . " id INTEGER NOT NULL" . ", url VARCHAR(80) NOT NULL" . ", notes VARCHAR...
2017-10-08, 220👍, 0💬

Number of Rows Selected or Affected in MySQL
How To Get the Number of Rows Selected or Affected by a SQL Statement in MySQL? There are two functions you can use the get the number of rows selected or affected by a SQL statement: mysql_num_rows($res) - Returns the number of rows selected in a result set object returned from SELECT statement. my...
2017-10-08, 210👍, 0💬

Fixing INSERT Command Denied Error in MySQL
How To Fix the INSERT Command Denied Error in MySQL? The reason for getting the "1142: INSERT command denied" error is that your user account does not have the INSERT privilege on the table or database. To resolve this error, you need to ask your MySQL DBA to grant you the right privilege. Your DBA ...
2017-10-08, 210👍, 0💬

Assign Names to Query Output Columns in MySQL
How To Name Query Output Columns in MySQL? Each column in the query output has a default name. If you don't like the default name, you can specify a new name for any column in the query output by using the AS clause. The following statement shows you a good example: mysql> SELECT tag AS Categ...
2017-09-28, 246👍, 0💬

Inner Join with the WHERE Clause in MySQL
How To Write an Inner Join with the WHERE Clause in MySQL? If you don't want to use the INNER JOIN ... ON clause to write an inner join, you can put the join condition in the WHERE clause as shown in the following query example: mysql> SELECT l.id, l.url, r.comment FROM fyi_links l, fyi_rates...
2017-09-28, 245👍, 0💬

Query with a Left Outer Join in MySQL
How To Write a Query with a Left Outer Join in MySQL? If you want to query from two tables with a left outer join, you can use the LEFT OUTER JOIN ... ON clause in the FROM clause. The following query returns output with a left outer join from two tables: fyi_links and fyi_rates. The join condition ...
2017-09-28, 237👍, 0💬

Query with a Full Outer Join in MySQL
How To Write a Query with a Full Outer Join in MySQL? There is no way to do full outer join in MySQL. It does not support this feature at the current MySQL release.   ⇒SELECT Statements with JOIN and Subqueries in MySQL ⇒⇒MySQL Database Tutorials
2017-09-28, 237👍, 0💬

Query with a Right Outer Join in MySQL
How To Write a Query with a Right Outer Join in MySQL? If you want to query from two tables with a right outer join, you can use the RIGHT OUTER JOIN ... ON clause in the FROM clause. The following query returns output with a right outer join from two tables: fyi_links and fyi_rates. The join condit...
2017-09-28, 234👍, 0💬

What Is a Result Set Object in MySQL
What Is a Result Set Object in MySQL? A result set object is a logical representation of data rows returned by mysql_query() function on SELECT statements. Every result set object has an internal pointer used to identify the current row in the result set. Once you get a result set object, you can us...
2017-09-20, 273👍, 0💬

Inserting Rows with a SELECT Statement in MySQL
How To Insert Multiple Rows with a SELECT Statement in MySQL? If want to insert rows into a table based on data rows from other tables, you can use a sub-query inside the INSERT statement as shown in the following script example: <?php include "mysql_connection.php"; $sql = "INSERT INTO fyi_l...
2017-09-20, 255👍, 0💬

What Is a Subquery in MySQL
What Is a Subquery in MySQL? A subquery is a SELECT statement used as part of the selection criteria of the main SELECT statement. The subquery specified in the WHERE clause will be evaluated repeated on each row of the selection base table. The output of the subquery will be used in the final evalu...
2017-09-17, 282👍, 0💬

Using Subqueries with the IN Operator in MySQL
How To Use Subqueries with the IN Operator in MySQL? A subquery can be used with the IN operator as "expression IN (subquery)". The subquery should return a single column with one or more rows to form a list of values to be used by the IN operation. The following tutorial exercise shows you how to u...
2017-09-17, 274👍, 0💬

1 2 3 4 5 6 > >>   Sort: Rank