Page 1 of 1

About sql in php

Posted: Fri Dec 23, 2005 3:54 pm
by Spectrum_tr
Hi. I want to create a table named "job" like this:

Code: Select all

$query4 = "create table job(id INT PRIMARY KEY,
				  username VARCHAR(30) NOT NULL,
				  sdate DATE NOT NULL,
				  edate DATE NOT NULL,
				  company VARCHAR(30) NOT NULL,
				  location VARCHAR(30) NOT NULL,
				  position VARCHAR(30) NOT NULL,
				  desc TEXT NOT NULL)";

if (mysql_query($query4))
	echo "Table job is created";
else
	echo "Table job can't be created, mysqlerror()";
But it is not creating. I think it's because of the "TEXT" type in the last column. But i have to use "TEXT" type for my project. So how can i create a column that has type "TEXT" like this?

Posted: Fri Dec 23, 2005 4:48 pm
by Spectrum_tr
ok i got it, the desc keyword was preserved for sql thats way it is not creating. thanks...