About sql in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Spectrum_tr
Forum Newbie
Posts: 14
Joined: Sat Dec 10, 2005 11:22 am

About sql in php

Post 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?
Spectrum_tr
Forum Newbie
Posts: 14
Joined: Sat Dec 10, 2005 11:22 am

Post by Spectrum_tr »

ok i got it, the desc keyword was preserved for sql thats way it is not creating. thanks...
Post Reply