Sponsored By
DataConverter
Advertise with Us
Advertisement
Advertise with Us
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog
Report Abuse Form
Reason:    
   

Home >> Database >> MYSQL >> There are some problem in creation of database
Author Post

Somesh


Total Post: 21
Member Since: 10/26/2010
Points: 107
There are some problem in creation of database
Posted On: 10/26/2010 9:51:06 AM
how we create database in mysql with php
please give syntex
thanks in advance
Author Post

Amit Singh


Total Post: 104
Member Since: 8/8/2010
Points: 702
Re: There are some problem in creation of database
Posted On: 11/8/2010 12:38:29 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);
?>
Report Abuse Form
Reason:    
 
Total Online Users: 4986
Advertisement
MindStick DataConverter
Advertise with Us
  
Copyright © 2014MindStick. All Rights Reserved.