pratik_learner
12-30-2005, 11:11 AM
$mysql_srv='127.0.0.1';
$user='root';
$pwd='secretword';
$link=mysql_connect($mysql_srv,$user,$pwd);
header('Content-type:text/plain');
$link?print_r("Connection compeleted\n"):die(mysql_error()."\nCan't Connect\n");
mysql_query("CREATE DATABASE IF NOT EXISTS ssqu")?print"DB ssqu created\n"
:die(mysql_error()."\nDB not created\n");
mysql_select_db('ssqu')?print"DB ssqu selected\n"
:die(mysql_error()."\nDB ssqu not selected\n");
$query="
CREATE TABLE IF NOT EXISTS table1 (
Path VARCHAR(250) NULL ,
Body VARCHAR(5000) NULL ,
Title VARCHAR( 100 ) NULL ,
Descr VARCHAR(600) NULL ,
Keywords VARCHAR(600) NULL ,
Author VARCHAR( 50 ) NULL ,
Title2 VARCHAR( 100 ) NULL
)";
mysql_query($query)
?print"Table1 on ssqu created\n"
:die(mysql_error()."\nTable1 not created\n");
$query="INSERT INTO table1 (Path, Body, Title, Descr, Keywords, Author, Title2) VALUES('path to heaven','Blah man blah dont you know it');";
mysql_query($query)?print"Inserted data\n":print"not goin the data\n\n".mysql_error();;
What's happening can anybody tell me using MySQL for 1st time
$user='root';
$pwd='secretword';
$link=mysql_connect($mysql_srv,$user,$pwd);
header('Content-type:text/plain');
$link?print_r("Connection compeleted\n"):die(mysql_error()."\nCan't Connect\n");
mysql_query("CREATE DATABASE IF NOT EXISTS ssqu")?print"DB ssqu created\n"
:die(mysql_error()."\nDB not created\n");
mysql_select_db('ssqu')?print"DB ssqu selected\n"
:die(mysql_error()."\nDB ssqu not selected\n");
$query="
CREATE TABLE IF NOT EXISTS table1 (
Path VARCHAR(250) NULL ,
Body VARCHAR(5000) NULL ,
Title VARCHAR( 100 ) NULL ,
Descr VARCHAR(600) NULL ,
Keywords VARCHAR(600) NULL ,
Author VARCHAR( 50 ) NULL ,
Title2 VARCHAR( 100 ) NULL
)";
mysql_query($query)
?print"Table1 on ssqu created\n"
:die(mysql_error()."\nTable1 not created\n");
$query="INSERT INTO table1 (Path, Body, Title, Descr, Keywords, Author, Title2) VALUES('path to heaven','Blah man blah dont you know it');";
mysql_query($query)?print"Inserted data\n":print"not goin the data\n\n".mysql_error();;
What's happening can anybody tell me using MySQL for 1st time