I am having difficulties sending the UDID from the iPhone to a PHP script to my MySQL database. I am not having a problem POSTing the data to the PHP script, but for some reason the PHP is not putting it into the database. I have tried entering "12343214312" as my example UDID and thats working, but the actual UDID is not for some reason. Is it some formatting mistake I am making?
Here is my code for the PHP:
<?php
$udidfromiphone = $_POST['udidfromiphone'];
//Connect To Database
$hostname='HOSTNAME.db.7774297.hostedresource.com';
$username='USERNAME';
$password='PASSWORD';
$dbname='DBNAME';
mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.');
mysql_select_db($dbname);
$query = "INSERT INTO mydatabase VALUES ($udidfromiphone,'7')";
echo "Values added";
mysql_query($query);
mysql_close();
?>
In my MySQL, I have two fields, one for UDID which is a varchar(60) and another field which is an integer.
Thanks!!