Page 1 of 1

insert a comma?

Posted: Thu Jan 22, 2004 1:47 pm
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...^^^

Posted: Thu Jan 22, 2004 1:50 pm
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 (',',',',',')";

Posted: Thu Jan 22, 2004 1:51 pm
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)