PHP mysql select average program example

php-mysql

PHP mysql select average program example PHP MySQL code to to calculate average.   <!doctype html> <html lang=”en”> <head> <meta charset=”utf-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1″> <title>Example of  avg function in php MySQL – Blog.eduguru.in</title> <meta name=”description” content=”Example of  avg function in php MySQL”> <link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css”> </head> <body> <div class=”container”> <div class=”row”> <div class=”col-md-12″> <h2>Example … Read more

MySQL AVG() function

mysql 5.7

MySQL AVG() function AVG function to calculate the average value of a set of values or an expression. The AVG() function returns the average value of a numeric column. If the function does not find a matching row, it returns NULL The DISTINCT option can also be used to return the average of the distinct values of expr. … Read more

MySQL count function

mysql 5.7

MySQL count function The COUNT() function returns the number of rows that matches a specified criteria. COUNT function to count the number rows in a table. The return type of the COUNT function is BIGINT. The COUNT function will return zero if there was no matching row found. The COUNT(*) function returns the number of rows in a … Read more

MySQL MIN() and MAX() Functions

mysql 5.7

MySQL MIN() and MAX() Functions   The MIN() function returns the smallest value of the selected column and the MAX() function returns the largest value of the selected column. MIN() Syntax SELECT MIN(column_name) FROM table_name WHERE condition; MAX() Syntax SELECT MAX(column_name) FROM table_name WHERE condition;

MySQL UPDATE Statement

mysql 5.7

MySQL UPDATE Statement The UPDATE statement is used to modify the existing records in a table. UPDATE Syntax: UPDATE tablename SET col1 = val1, col2 = value2, … WHERE condition; Be careful when updating records in a table! Notice the WHERE clause in the UPDATE statement. The WHERE clause specifies which record(s) that should be updated. If you omit the WHERE clause, all records … Read more

MySQL where condition

mysql 5.7

MySQL where condition   WHERE Syntax SELECT column1, column2, … FROM table_name WHERE condition; Note: The WHERE clause is not only used in SELECT statement, it is also used in UPDATE, DELETE statement, etc.!   SELECT * FROM Customers WHERE Country=’Mexico’;   Operators in The WHERE Clause The following operators can be used in the WHERE clause: Operator Description = Equal <> Not equal. Note: In … Read more

mysql create index on table

mysql 5.7

mysql create index on table   CREATE INDEX Syntax Creates an index on a table. Duplicate values are allowed: CREATE INDEX index_name ON table_name (column1, column2, …); CREATE UNIQUE INDEX Syntax Creates a unique index on a table. Duplicate values are not allowed: CREATE UNIQUE INDEX index_name ON table_name (column1, column2, …); Note: The syntax for creating indexes varies among different databases. Therefore: Check the syntax for … Read more

MySQL Server Logs

mysql 5.7

 MySQL Server Logs MySQL Server has several logs that can help you find out what activity is taking place. By default, no logs are enabled, except the error log on Windows. (The DDL log is always created when required, and has no user-configurable options. The following logspecific sections provide information about the server options that … Read more

mysqld dead but subsys locked

mysql 5.7

mysqld dead but subsys locked Backup for future Safety: cp /var/lock/subsys/mysqld /root/mysqld than delete it rm /var/lock/subsys/mysqld then close all services that depends on mysql: service httpd stop and after that: service mysqld restart service httpd restart