insert a comma?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
lizlazloz
Forum Commoner
Posts: 64
Joined: Mon Dec 29, 2003 7:29 am

insert a comma?

Post by lizlazloz »

ok, say i want to start a new entry into a table, and want to insert the default value as a comma, hwo would i do that?

insert into mytable ( name,age,nosehair) values (",",",",",")

^^^doesnt work...^^^
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

because you need to use single quotes i'd imagine ( and also make sure the field type is varchar )...

Code: Select all

$sql = "insert into mytable ( name,age,nosehair) values (',',',',',')";
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

What database? mysql...pgsql.. ?
And what are the column types, and what error does it give?

(works ok with mysql and all columns as varchars)
Post Reply