Thursday, May 23, 2013

left join


select a.id,b.phone
from a
right join b
on a.id=b.emp_id

where a and b is table

Monday, May 20, 2013

upload server image in local disk using php



<?php
function img_url()
{

$num=rand(1,99999999999999999999)-rand(5000,8585858571);
$urls=$_SERVER['REMOTE_ADDR'];
$ip=$_SERVER['HTTP_HOST'];

$filename=$num."_".$urls;
$img = 'img/'.$filename.'.jpg';
file_put_contents($img, file_get_contents($url));
$file_location='http://www.'.$ip.'/'.$img;

//echo $file_location;

//echo '<img src="'.$file_location.'" height="auto" width="auto" style="border:0px solid green" />';
echo '
<img src="'.$url.'" />
';
}

img_url();

?>