Openshift mysql write access from php
<p>I have an issue with my mysql database that I can't resolve : I have a scalable application with mysql and php. I can access the database but I can only read ('SELECT') the data but I don't seem to have the permission to write ('INSERT INTO...').</p>

<p>Here is the php file for SELECT command which is working :</p>

<pre><code>&lt;?php
$cnx = mysql_connect("domain:port","username","password");
$db= mysql_select_db( "application_name" );
$username = $_POST['username'];
$password = $_POST['password'];
$sql = "SELECT * FROM `User` where `userName`='$username' AND `password`='$password'";
$requete = mysql_query($sql ,$cnx);

if(mysql_num_fields($requete)==0){
  echo "0";
}
else {
$result = mysql_fetch_assoc( $requete );
    echo $result["userKey"];
}?&gt;
</code></pre>

<p>And the php file for INSERT INTO command which is not working :</p>

<pre><code>&lt;?php
$con=mysql_connect("domain:port","username","password","application_name");
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
$sql="INSERT INTO User(userName,emailAdress,password) VALUES ('$username','$email','$password')";
if (mysqli_query($con,$sql))
{
  echo "0";
}
?&gt;
</code></pre>

<p>Thanks for your help !</p>