<?php
$con = mysqli_connect("192.168.1.55", "root", "", "webtech");
if (mysqli_connect_errno()) {
    die('Could not connect: ' . mysqli_connect_error());
}
class db_query
{
	function getField($table, $condition, $val, $field)
	{
		global $con;
		$sql = mysqli_query($con, "select " . $field . " from " . $table . " where " . $condition . " ='" . mysqli_real_escape_string($con, $val) . "'");
		$r = mysqli_fetch_array($sql);
		return ($r[$field]);
	}
	function GetFieldValue($table, $condition, $field)
	{
		global $con;
		$sql = mysqli_query($con, "select " . $field . " from " . $table . " where  $condition  ");
		$r = mysqli_fetch_array($sql);
		return ($r[$field]);
	}
}
$s = new db_query();
