<?

		class db
		{
		
				function connect()
				{
				
					
						
						mysql_connect("localhost","root","");
						
						mysql_query("use multiapp_new");

						
						
						/*mysql_connect("122.165.224.226", "root", "rambo");

						mysql_query("use multiapp");*/

						mysql_query('SET NAMES utf8');

						
						
						
						/*mysql_connect("localhost","safefire","ytrewq_654321");
						
						mysql_query("use  safefire_multiapp");*/

						
						
						/*mysql_connect("localhost","spgwareh_root","!@#$%^");
						
						mysql_query("use spgwareh_meenakshi");*/
												
				
				}
				
				
				
				function rows($query)
				{
							
							
							$result=mysql_num_rows($query);
							
							return $result;
				
				
				
				}
				
				function select($tblname,$fieldname,$condn="")
				{
				
						if($condn=="")
						{
						
						
								$select_details=mysql_query("select ".$fieldname." from ".$tblname);	
					
						
						}
						else
						{
														
								$select_details=mysql_query("select ".$fieldname." from ".$tblname." ".$condn);

								
								
								
						
						}
						
				
								//echo "select ".$fieldname." from ".$tblname." ".$condn;
			
								return $select_details;
							
				
				}
				function update($tblname,$update_value,$condn)
				{
				
								$update_details=mysql_query("update ".$tblname." set ".$update_value." ".$condn);
								
								

								return $update_details;
				
				
				}
				function insert($tblname,$fieldname,$fieldvalues)
				{
				
								$insert_details=mysql_query("insert into ".$tblname." ".$fieldname." values ".$fieldvalues);
	
								//echo "insert into ".$tblname." ".$fieldname." values ".$fieldvalues;
													
								return $insert_details;
							
				
				}
				function delete($tblname,$condn="")
				{
				
				
								if($condn=="")
								{
				
							    		$delete_details=mysql_query("delete from ".$tblname);
										
								}
								else
								{
								
										$delete_details=mysql_query("delete from ".$tblname." ".$condn);
								
								}		
				
										return $delete_details;
									
				
				}
				
				function fetch($query)
				{
				
				
				
							$result=mysql_fetch_array($query);
							
						
							return $result;
				
				
				
				}
				
		
		
		}
		
		$db=new db;
		
		$db->connect();
	

?>