Category: sql & mysql
-
PHP v/s .net
This blog I write today that about to PHP vs .NET. I’m ex. Microsoft Student Partner and Microsoft Certified Developers even if I’m oppose to .NET. Why? Find my answers below. PHP is a free open source. So, we should not need to pay any fees for PHP. PHP is runs on various operating system.…
-
how to connect mysql from command prompt
First open command prompt : write command : mysql -u username -p database_name and press enter key and enter password of mysql Or write a command : mysql –user=username –password=password
-
How to convert mysql date format to own date format in MYSQL?
SELECT sum(rate),DATE_FORMAT(date_time, ‘%Y-%c-%d’) as dt FROM `trans_tble` group by `dt` Reff link : http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format
-
how to working with two database in php/mysql?
//connection file //tested in php 5.3.5 & mysql 5.5.8 //make sure database username & database host are same at same place… $host=”localhost”; $dbnm=’db1′; $dbunm=’root’; $dbpass=”; $conn=mysql_connect($host,$dbunm,$dbpass); $db=mysql_select_db($dbnm,$conn); //==================================================================// $host_=”localhost”; $dbnm_=’db2′; $dbunm_=’root’; $dbpass_=”; $conn_=mysql_connect($host_,$dbunm_,$dbpass_); mysql_select_db($dbnm_,$conn_) or die(mysql_error()); //============== Example =============================// $sql=”select * from db1.test”; $re=mysql_query($sql) or die(mysql_error()); $sql_=”select * from db2.test”; $re_=mysql_query($sql_); //join query between two database’s tables….…
-
How to convert timestamp to date in MYSQL with where clause?
SELECT * , DATE( FROM_UNIXTIME( `time_stamp` ) ) AS sBdat FROM phpfox_feed WHERE DATE( FROM_UNIXTIME( `time_stamp` ) ) = ‘2012-09-05’