Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 19-05-2009
Member
 
Join Date: Apr 2009
Posts: 87
Programmatically add a database

I am trying to create database with user. Which contain the information about user id, user address, user name with user age in form of table. Is there any way to programmatically create a database and setup users for MySQL.
Reply With Quote
  #2  
Old 19-05-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Programmatically add a database

When you try to connect database programmatically you have to switch between the local computer and the server. To connect database use the following program :

Code:
<?php

function connect_database()
{
$user_name ="";
$password="";
$database_name="local_database_name";
$db_host="localhost";
$db=mysql_connect($db_host, $user_name, $password);
if (mysql_error() > "") print mysql_error() . "<br>";
mysql_select_db($database_name, $db);
if (mysql_error() > "") print mysql_error() . "<br>";
}

?>
Reply With Quote
  #3  
Old 19-05-2009
Member
 
Join Date: Jan 2009
Posts: 199
Re: Programmatically add a database

If you want to connect database as root or any other user with all access :
create database mydb;
Grant all permission on database;
delete privileges;
to myuser at my host identify by mypass;
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Programmatically add a database"
Thread Thread Starter Forum Replies Last Post
System wake up from Standby/Hibernate to be done Programmatically Eigenberg Windows XP Support 14 24-09-2010 06:00 AM
Change FireFox proxy setting programmatically Puloma Software Development 4 21-09-2010 06:50 AM
asp.net adding databound hyperlink columns to gridview programmatically Amitesh Software Development 2 05-06-2009 12:02 AM
Add Columns to GridView Programmatically Firon Software Development 3 19-05-2009 06:44 PM
Free SMS Server to send SMS programmatically Cavan Networking & Security 3 16-05-2009 08:23 PM


All times are GMT +5.5. The time now is 04:42 PM.