Home > DeveloperSection > Forums > There are some problem in creation of database
Somesh

Total Post:21

Points:147
Posted on    October-26-2010 9:51 AM

 MYSQL MYSQL 
Ratings:


 1 Reply(s)
 1501  View(s)
Rate this:
how we create database in mysql with php
please give syntex
thanks in advance


Amit Singh

Total Post:103

Points:721
Posted on    November-08-2010 12:38 AM

Create database 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);
?>















Recent Activities



Maria Susan Created New Discussion Issue with open tab group in titanium   16 hours ago

Sumit Kesarwani added new Question What is the serialization?   4 days ago

Don't want to miss updates? Please click the below button!