Page 1 of 1

[SOLVED] whats is the set of orders to build a database

Posted: Tue Dec 09, 2003 6:07 am
by pelegk2
and then a table with its columns
using php and mysql database?
thnaks inadvance
peleg

Posted: Tue Dec 09, 2003 6:27 am
by twigletmac
Start with the MySQL manual - http://www.mysql.com/doc - it has all the SQL commands you will need.

Mac

Posted: Tue Dec 09, 2003 10:40 am
by m3mn0n
Also read into http://www.php.net/mysql :)

Posted: Tue Dec 09, 2003 3:39 pm
by xisle
definitely look through the manual and a tutorial or 3..
here is a sample once you are ready to tackle it:

Code: Select all

<?php

$link=MYSQL_CONNECT($host,$username,$password) OR DIE("Unable to connect to database")

$query = "CREATE TABLE Browser (
  id int(11) NOT NULL auto_increment,
  data text NOT NULL,
  platform varchar(25) NOT NULL default '',
  type varchar(25) NOT NULL default '',
  version varchar(25) NOT NULL default '',
  PRIMARY KEY  (id)
)";

$result=mysql_query($query,$link) or die(mysql_error()."$query");

?>

Posted: Wed Dec 10, 2003 8:13 pm
by xisle
you'll need to create the DB first by running
a query command line or with php..

CREATE DATABASE dbname

sorry forgot that step... :?

Posted: Thu Dec 11, 2003 1:14 am
by pelegk2
thanks alot every one