Login desde android a servidor php

[php]
<?php
$un=$_POST[‘username’];
$pw=$_POST[‘password’];

$user = ‘usuario’;
$pswd = ‘usuario_clave’;
$db = ‘base_de_datos’;

$conn = mysql_connect(‘localhost’, $user, $pswd);

mysql_select_db($db, $conn);
$query = "SELECT * FROM people WHERE username = ‘$un’ AND password = ‘$pw’";
$result = mysql_query($query) or die("Unable to verify user because : " . mysql_error());

if(mysql_num_rows($result) == 1){
echo 1;
}else{
echo 0;
}
?>
[/php]

[sql]
CREATE TABLE IF NOT EXISTS `people` (
`id` int(4) NOT NULL auto_increment,
`username` varchar(250) default NULL,
`password` varchar(250) default NULL,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

INSERT INTO `people` (`id`, `username`, `password`) VALUES
(1, ‘juliopari’, ‘123456’),
(2, ‘jpari18’, ‘123456789’);
[/sql]

post-author