Jeffro Posted May 3, 2011 Share Posted May 3, 2011 Shouldn't the following stop a blank row from being inserted into mysql? I have a description and a date but it still keeps putting a blank row before my insert and I've tried everything.... if($myvar != ''){ mysql_query("INSERT IGNORE INTO products (description, time) VALUES('$myvar',NOW() ) ") or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/235393-blank-row-being-inserted-in-top-of-mysql/ Share on other sites More sharing options...
Jeffro Posted May 3, 2011 Author Share Posted May 3, 2011 nevermind.. after trying everything under the sun to remove a blank character I couldn't see, I finally just used substr to remove the 1st character and it worked. [smacks his own head...] Link to comment https://forums.phpfreaks.com/topic/235393-blank-row-being-inserted-in-top-of-mysql/#findComment-1209721 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.