Posts

Get Next Month Data in PHP

<?php //***************** Query ************ $query = "select * from test_table where date < date_sub(now(), interval 1 month)" ; $res_query = mysql_query($query); //*********** OUTPUT ************ int_id      name        date 1           Sandy     04-06-2015 2           Vandy    11-06-2015 3           Andy     18-06-2015 //******************************** ?>

Php Open Tag setting

Image
See the below image

Ajax Method in Jquery

<div dir="ltr" style="text-align: left;" trbidi="on"> <br /> <h1>Ajax Method in Jquery</h1> <pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivzH9V1GHFkK0q0bNtjJguqmg7i1bgxDsQWSCI9cnYgxNE7dA0bZvBWbqlA_dzq3nMzmWXOvoqdRA1U4Hg4pJHeN2PZAqEeWfX_tsXGN-03XK_CRONhL-dy46GIhewvLgeD2l0PhsYb8Mm/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"><code style="color:#000000;word-wrap:normal;"> $(document).ready(function() { $("#from_station1").change(function(){ var city_id = $(this).val(); $.ajax({ method: "POST", url: "get_to_station.php?city_id=" + city_id, success:function(data) { $("#settostation").html(data); // data setting on...

Online Currency Convertor

Online Currency Convertor In PHP <b>&lt;?php <br />$from = "USD";<br />$to = "INR";<br />$url = 'http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency='.$from.'&amp;ToCurrency='.$to;<br />$rate = simplexml_load_file($url);<br />echo 'Rate from '.$from.' to '.$to.' is: '.$rate[0];<br />?&gt; </b><br /> <br />

Only Show Current & Before Year

<select name="year" id='year' class="form-control"> <option value=""> Select </option> <?php $before = 0; // Specify number of "year" selections. $year = date('Y'); for( $i=4; $i>=$before; $i--) { $t = $year - $i; echo("<option value=\"$t\">$t</option>"); } ?> </select>

Get Data By Month and Year

<h2>Get Data By Month and Year</h2> <div dir="ltr" style="text-align: left;" trbidi="on"> <br /> function getLeave()<br />&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;db-&gt;where('MONTH(CURDATE()) = MONTH(emp_leave_start_date) and&nbsp; YEAR(CURDATE()) = YEAR(emp_leave_start_date)');<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $query = $this-&gt;db-&gt;get('employee_leave');<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $query-&gt;result();<br />&nbsp;&nbsp;&nbsp; }</div>

dbsetting

<?php class Dbsetting extends CI_Model { function Dbsetting() { // Call the Model constructor parent::__construct(); $this->load->database(); } public function insert($tablename,$data) { if($this->db->insert($tablename,$data)) { return true; } else { return false; } return true; } function getInfo_($query,$return='') { $query=$this->db->query($query); if($return=='') { return $query->row(); } else { return $query->result(); } } function delete($table_name,$array) { foreach($array as $key=>$value) { $this->db->where($key,$value); } $this->db->delete($table_name); return true; } public function update($table_name,$array,$data) { foreach($array as $key=...