Author: darshakkumar

  • Convert Varchar to Date Format in mysql

    SELECT *  FROM `tMembers` where str_to_date(sBirthDay,”%m/%d/%Y”) between str_to_date(’12/15/1985′,”%m/%d/%Y”) and str_to_date(’09/22/1987′,”%m/%d/%Y”)

  • Youtube API(Upload video to our website)

    First, download Zend Framework…… <?php //debug #error_reporting(E_ALL); //include Zend Gdata Libs require_once(“Zend/Gdata/ClientLogin.php”); require_once(“Zend/Gdata/HttpClient.php”); require_once(“Zend/Gdata/YouTube.php”); require_once(“Zend/Gdata/App/MediaFileSource.php”); require_once(“Zend/Gdata/App/HttpException.php”); require_once(‘Zend/Uri/Http.php’); //yt account info $yt_user = ‘ ‘; //youtube username or gmail account $yt_pw = ‘  ‘; //account password $yt_source = ‘jh’; //name of application (can be anything) //video path $video_url = ‘1.mov’; //yt dev key $yt_api_key = ‘AI39s…’;…

  • Display data dynamically in Matrix format using PHP with pagination

    <?php $per_page = 6; $display_columns = 3; $page = isset($_GET[‘page’]) ? (int) $_GET[‘page’] : 1; $pages = implode(mysql_fetch_assoc(mysql_query(“SELECT COUNT(*) FROM projects”))); //$pages= $pages/$display_columns; $pages = ceil($pages / $per_page); $querystring = “”; foreach ($_GET as $key => $value) { if ($key != “page”) $querystring .= “$key=$value&amp;”; } echo “Pages: “; for ($i = 1; $i <=…

  • VB.NET Connection String

    Imports System.Data.OleDb Public Class Form1 Dim connetionString As String Dim conn As OleDbConnection Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click connetionString = “Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\USER\Documents\Database3.accdb” conn = New OleDbConnection(connetionString) Try conn.Open() MsgBox(“Done”) conn.Close() Catch ex As Exception MsgBox(“Not Done”) End Try End Sub End Class

  • PHP: Mail with HTML and mail() function.

    <?php include (“include/config.php”); $fname=$_POST[‘name’]; $email=”From:”.$_POST[’email’]; $comp=$_POST[‘company’]; $msg1=$_POST[‘message’]; $tomail=”swapn_developers@yahoo.com”; $msg=”Company Name : ” .$comp.” “.”Message : ” .$msg1; $headers = “From: $email\r\n”; $headers .= “Content-type: text/html\r\n”; mail($tomail,”Contact Us Message”,$msg,$headers); ?>

  • How to Download Image , txt file or any file without save as or without open in php?

    <?php $file=$_GET[‘file’];//get the file name //$file = ‘monkey.gif’; if (file_exists($file)) { header(‘Content-Description: File Transfer’); header(‘Content-Type: application/octet-stream’); header(‘Content-Disposition: attachment; filename=’.basename($file)); header(‘Content-Transfer-Encoding: binary’); header(‘Expires: 0’); header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0’); header(‘Pragma: public’); header(‘Content-Length: ‘ . filesize($file)); ob_clean(); flush(); readfile($file); exit; } ?>

  • AJAX-Passing the multiple value to another page.

    function searchDoc1(str,str1) { if (str==””) { document.getElementById(“list”).innerHTML=””; return; } if (str1==””) { document.getElementById(“list”).innerHTML=””; return; } if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { //alert(xmlhttp.responseText); document.getElementById(“list”).innerHTML=xmlhttp.responseText; } else if(xmlhttp.readyState==3)//waiting Module { document.getElementById(“list”).innerHTML = “waiting”;// or “using the image tag to display image” } } var url1=”list_out.php”…

  • INNER JOIN in MYSQL

    SELECT * FROM shipping_name as sn INNER JOIN region_shipping as rs ON (rs.ship_id=sn.id) where rs.reg1!=” and rs.reg_1!=” or rs.reg2!=” and rs.reg_2!=” or rs.reg3!=” and rs.reg_3!=” or rs.reg4!=” and rs.reg_4!=” or rs.reg5!=” and rs.reg_5!=” or rs.reg6!=” and rs.reg_6!=” and sn.ship_price!=”

  • bb-press customize login module

    if ( !function_exists(‘bb_check_login’) ) : function bb_check_login($user, $pass, $already_md5 = false) { global $wp_users_object; if ( !bb_get_option( ’email_login’ ) || false === strpos( $user, ‘@’ ) ) { // user_login $user = $wp_users_object->get_user( $user, array( ‘by’ => ‘login’ ) ); } else { // maybe an email echo $email_user = $wp_users_object->get_user( $user, array( ‘by’ =>…