[SIZE=2]Hi All,
I’m building a live poll in Flash using PHP and mySQL but I keep getting this warning message?
Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:\inetpub\wwwroot\umi_polling\vote.php on line 9
I’ve entered the correct host, username and password but for some reason, I still can’t connect to the mySQL database. Here is the code that I am using:
[/SIZE]
<?
//User, password & database
//$choice =$_POST['choice'];
$choice ="1";
$host="myHost"
$user="myUser";
$password="myPass";
$database="umi_polling";
mysql_connect($host,$user,$password);
@mysql_select_db($database) or die("Unable to connect to database");
// what choice did the user choose in flash?
if($choice == 1){
$query="UPDATE umi_polling SET YES=YES+1";
}
if($choice == 2){
$query="UPDATE umi_polling SET NO=NO+1";
}
mysql_query($query);
//Get values from the database
$query="SELECT * FROM umi_polling";
$result=mysql_query($query);
mysql_close();
//What are the values from the database?
$vote1_out=mysql_result($result,0,"YES");
$vote2_out=mysql_result($result,0,"NO");
//Votes in total
$total=$vote1_out+$vote2_out;
//Info to send back to flash:
$values="&totalVotes=$total&vote1total=$vote1_out&vote2total=$vote2_out";
echo "$values ";
?>
I really appreciate any help.