Showing posts with label sql. Show all posts
Showing posts with label sql. Show all posts

12 March 2014

How to Subtract Two values in SQL query

Problem: How to subtract two values in a sql query to get the difference ? 

(If you found this article useful then share with your friends.)

26 May 2012

Get the dayname of current week using SQL with system function

For MS SQL Server 2005,

This query result with output of today's name of the day :
for example , sunday or monday etc.


SELECT { fn DAYNAME(GETDATE()) } AS Expr1

This is a system defined function , so you can use it to get the todays day .

(If you found this article useful then share with your friends.)

17 November 2011

PHP MySQL data not showing from result after query

Nice and helpful post.

Output: Resource id #3

Solution: use mysql_fetch_row( $result ) in a while loop to get all result in an array..


(If you found this article useful then share with your friends.)

24 October 2010

Some useful PHP MYSQL functions

php
PHP MYSQL functions helps to connect to the database in MySQL software.
These are some of the most frequently used function names :


mysql_connect — Open a connection to a MySQL Server

mysql_create_db — Create a MySQL database

mysql_error — Returns the text of the error message from previous MySQL operation

mysql_fetch_array — Fetch a result row as an associative array, a numeric array, or both

mysql_num_rows — Get number of rows in result

mysql_query — Send a MySQL query

mysql_tablename — Get table name of field

mysql_close — Close MySQL connection

(If you found this article useful then share with your friends.)