---
title: "There are some problem in creation of database"  
description: "There are some problem in creation of database"  
author: "Somesh"  
published: 2010-10-26  
updated: 2010-11-08  
canonical: https://www.mindstick.com/forum/61/there-are-some-problem-in-creation-of-database  
category: "mysql"  
tags: ["mysql"]  
reading_time: 1 minute  

---

# There are some problem in creation of database

how we [create database](https://www.mindstick.com/articles/1623/sfdc-create-an-app-and-database) in [mysql](https://www.mindstick.com/articles/12156/what-is-mysql) with [php](https://www.mindstick.com/articles/12149/php-constant-and-php-variables)\
please give syntex\
thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)

## Replies

### Reply by Amit Singh

Create [database](https://www.mindstick.com/articles/12226/use-of-database-in-sencha-extjs-and-insert-record-from-user-form-using-ajax) between mysql and php \
using syntax\
**Create database databaseName**\
\
we write syntax in php for creation of database\
**Example**\

```
<?php$con = mysql_connect("localhost","sa","sa");if (!$con)  {  die('Could not connect: ' . mysql_error());  }if (mysql_query("CREATE DATABASE my_db",$con)) //Create database and check the condition  {  echo "Database created";  }else  {  echo "Error creating database: " . mysql_error();  }mysql_close($con);?>
```


---

Original Source: https://www.mindstick.com/forum/61/there-are-some-problem-in-creation-of-database

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
