Posted by: sggoyal | September 5, 2008

Upload File using php

<?php

if(isset($_POST[‘submit’])) {
   // To Save file into server
    $upload_dir = ‘uploadfile/’;
   
    // Check direcory is exist or not
    if(@!opendir($upload_dir)) {
     mkdir($upload_dir , 0755);
    }
   
    if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
     // Start Code for Report
     $filename = time().’_’.$_FILES['userfile']['name'];
     $uploaded_file = $upload_dir.$filename;
     copy($_FILES['userfile']["tmp_name"],$uploaded_file);
    }
    else
    {
      echo “file not upload successful”;
    }
}

?>

<form action=”" method=”post” enctype=”multipart/form-data” >
<input type=”file” name=’userfile’ />
<input type=”submit” name=”submit” />
</form>

 

Some developer forget enctype=”multipart/form-data” in form tag that means $_file[] = ” .So,Please make sure about it.

Posted by: sggoyal | July 30, 2008

Query to show not match records

Query to show not match records

Two Table :-
Transaction Table 1(trans1):-

TDate1       trans_no
7/21/2008  451
7/21/2008  452
7/21/2008  453
7/21/2008  454
7/21/2008  455
7/21/2008  456
7/21/2008  457

Transaction Table 2(trans2):-

TDate2       trans_no
7/21/2008  451
7/21/2008  456
7/21/2008  561
7/21/2008  871
7/21/2008  981
7/21/2008  453

Query:-

Show Record Where trans1 trans_no is not match with trans2 trans_no but date are same

SELECT t1.TDate1,
t1.trans_no
from trans1 as t1
left join trans2 as t2
on t1.trans_no = t2.trans_no
where t2.trans_no is null
and t1.TDate1 between ‘2008-07-21′
and ‘2008-07-21′

Posted by: sggoyal | July 17, 2008

Newline (\n) not working in Notepad

Newline (\n) not working in Notepad?

Field row /value not show on next line in notepad?

Ans :-

Just add “\r\n” instend of “\n” only

« Newer Posts - Older Posts »

Categories