Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // model
- require_once 'db_config.php';
- class Model{
- function _construct($host, $user, $pass, $dbname){
- global $host, $user, $pass, $dbname, $conn, $db;
- //$host = "localhost";
- //$user = "root";
- //$pass = "";
- //$dbname = "komcua";
- $conn = mysql_connect($host, $user, $pass) or die(mysql_error());;
- $db = mysql_select_db($db_name);
- }
- function getCityCode( $location ){
- $query = "SELECT * FROM citycode WHERE CityName LIKE '" . $location . "'";
- $result = mysql_query($query);
- if(!$result){
- $row = mysql_result( $result, 1);
- return $row;
- }
- else{
- echo mysql_error();
- return false;
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement