Jump to content

Insert varchar containing space = fail


mikafi

Recommended Posts

I have troubles inserting varchar to mySQL table containing space (" "). Whenever the string has space in it, the inserting fails and nothing is added to the table.

 

My php code looks like this in terms of inserting values:

 

$query="INSERT INTO table
	VALUES ('null', '$name', '$score', '$description', CURRENT_TIMESTAMP)";

 

It does work when there are no spaces in either name or description which are VARCHARs.

 

Is it normal that this fails when the strings contain a space?

Link to comment
https://forums.phpfreaks.com/topic/246896-insert-varchar-containing-space-fail/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.