Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //if you want to require one of them
- if(trim($_REQUEST['username']) || $_REQUEST['date'] || $_REQUEST['employee'])
- {
- $dbhost = "localhost";
- $dbuser = "root";
- $dbpass = "p4ssw0rd";
- $dbname = "webcall";
- //Connect to MySQL Server
- mysql_connect($dbhost, $dbuser, $dbpass);
- //Select Database
- mysql_select_db($dbname) or die(mysql_error());
- // Retrieve data from Query String
- $where="";
- $query = "SELECT * FROM LS_webcall";
- if(trim($_REQUEST['username']))
- $where.= " and webcall_username='" . mysql_real_escape_string($_REQUEST['username']) ."' ";
- if(trim($_REQUEST['startdate']))
- $where.= " and `webcall_date >= STR_TO_DATE('" . mysql_real_escape_string($_REQUEST['startdate']) ."','%b %d %Y') ";
- if(trim($_REQUEST['enddate']))
- $where.= " and `webcall_date >= STR_TO_DATE('" . mysql_real_escape_string($_REQUEST['enddate']) ."','%b %d %Y') ";
- if(trim($_REQUEST['employee']))
- $where.= " and webcall_employee='" . mysql_real_escape_string($_REQUEST['employee']) ."' ";
- if($where!='')
- $query.= " where " . trim($where, ' and');
- $qry_result = mysql_query($query) or die(mysql_error());
- ////////////////BLAH
- }
- else
- die('submit something');
Add Comment
Please, Sign In to add comment