After much surfing, I finally found the answer which I would like to share with people that is trying to use JQWidgets with Openshift.
You simply need to paste the following text into connect.php file:
<?php
# FileName=”connect.php”
$hostname = getenv(“OPENSHIFT_MYSQL_DB_HOST”);
$username = getenv(“OPENSHIFT_MYSQL_DB_USERNAME”);
$password = getenv(“OPENSHIFT_MYSQL_DB_PASSWORD”);
$database = getenv(“OPENSHIFT_APP_NAME”);
?>
And the connection comes alive!!