Here is a very basic webservice to query mysql database via GET or POST methods. It will return the result in json format. <?php /** * @filename service.php * @author Abhishek Kumar **/ include 'config.php'; function db_query($iQuery, $iReturn) { $output = array(); if($connection = mysql_connect(DB_HOST, DB_USER, DB_PASS)) if($database = mysql_select_db(DB_SCHEMA)) if($result = mysql_query($iQuery)) { if($iReturn) { while ($data[] = mysql_fetch_array($result, MYSQL_ASSOC)); mysql_free_result($result); $output['success'] = $data; } else $output['success'] = $result; mysql_close($connection); } else $output['failure'] = mysql_error(); else $output['failure'] = mysql_error(); else $output['failure'] = mysql_error(); return $output; } $query = (!isset($_REQUEST['query']))? NULL : $_REQUEST['query']; $type = (!isset($_REQUEST['type...
Possible solutions of Impossible problem. Out-of-the-box Ideas. Amazing notes. Unbelievable facts. Simple & easy to follow tips and procedures.