Category Covered

How to change date format of database output in php  

MySQL stores the date in any database (by default) as 'YYYY-MM-DD' .To change date format in any type you can use DATE_FORMAT function in your sql query.
As for example:
$mytest  = “SELECT  yearday as selected_date from balm_yearday   where DATE_FORMAT(yearday,"%d-%m-%y") '';
echo $mytest;
output : 20-01-2015.
Here you can give any type date format such as d/m/y or d-m-y o  
By: mimosa  |   Total Read: 1266  |   Read more..

Mysql store procedure and function example  

Here are some rough sample example of store procedure and mysql sample that will help you to understand   CALL albumItems; DELIMITER $$ USE `areslog_shanghai`$$ DROP PROCEDURE IF EXISTS `albumItems`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `albumItems`() BEGIN SELECT *, FnItemPartyAlbum(id) AS funcResults FROM areslog_shanghai.nite_parties; END$$ DELIMITER ; DELIMITER $$ DROP FUNCTION IF EXISTS  
By: Tech writer  |   Total Read: 1751  |   Read more..

Basic mysql stored procedure  

DELIMITER $$ CREATE PROCEDURE `areslog_shanghai`.`albumItems`() BEGIN END$$ DELIMITER ; another example ------------------- DELIMITER $$ USE `areslog_shanghai`$$ DROP PROCEDURE IF EXISTS `albumItems`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `albumItems`() BEGIN SELECT * FROM areslog_shanghai.nite_parties; END$$ DELIMITER ;  
By: Tech writer  |   Total Read: 1704  |   Read more..

How to automatically encrypted users password  

  A new user completes the registration form, his password will be encrypted automatically by using the following code into your connection page up page . <?php $users = users_table_name; function addNewUser($username, $password){
   global $connection;
   $password = md5($password);
   $enc = "INSERT  INTO  ".users."  VALUES ('$username', '$password')&qu  
By: mimosa  |   Total Read: 1147  |   Read more..

php mysql connection  

<?php
$username = "yourMysqlUserName";
$password = "yourMysqlPassword";
$hostname = "yourHostName"; if you use wamp/xxamp then default setting for user, password and host will be something like that $username = "root";
$password = "";
$hostname = "localhost"; //Here mysql_connection is a mysql function that will connect to the database
$con  
By: Tech writer  |   Total Read: 2094  |   Read more..
Top 15 Posts
Google+