phppaper Posted March 10, 2008 Share Posted March 10, 2008 Hello, I have a empty field of MYSQL and would like to write it with PHP but I dont know how, please help, example: $SQL = "SELECT * FROM table where field = ??? "; "???" is empty field, what should I fill in? Thanks Link to comment https://forums.phpfreaks.com/topic/95322-mysql-empty-field-in-php/ Share on other sites More sharing options...
mikefrederick Posted March 10, 2008 Share Posted March 10, 2008 are you trying to insert something into the database? if so, : mysql_query("insert into tablename (field1,field2) values ('value1','value2')"); Link to comment https://forums.phpfreaks.com/topic/95322-mysql-empty-field-in-php/#findComment-488247 Share on other sites More sharing options...
xProteuSx Posted March 10, 2008 Share Posted March 10, 2008 Are you trying to write to a table, or are you trying to read from a table? The SELECT option is used to read from a table. If you answer this question, someone will be able to help you. Link to comment https://forums.phpfreaks.com/topic/95322-mysql-empty-field-in-php/#findComment-488259 Share on other sites More sharing options...
phppaper Posted March 10, 2008 Author Share Posted March 10, 2008 I just want to know what represents am empty MySQL field in PHP language and that was just an example ^^ Is it "" or '' or NULL?? Link to comment https://forums.phpfreaks.com/topic/95322-mysql-empty-field-in-php/#findComment-488260 Share on other sites More sharing options...
Nuv Posted March 10, 2008 Share Posted March 10, 2008 Thats field has a name? Link to comment https://forums.phpfreaks.com/topic/95322-mysql-empty-field-in-php/#findComment-488264 Share on other sites More sharing options...
phppaper Posted March 10, 2008 Author Share Posted March 10, 2008 lets say the field name is "time" Link to comment https://forums.phpfreaks.com/topic/95322-mysql-empty-field-in-php/#findComment-488275 Share on other sites More sharing options...
l0ve2hat3 Posted March 10, 2008 Share Posted March 10, 2008 this should work if mysql field isn't NULL $sql= "SELECT * FROM table WHERE field='' "; if it is do this: $sql= "SELECT * FROM table WHERE field='NULL' "; Link to comment https://forums.phpfreaks.com/topic/95322-mysql-empty-field-in-php/#findComment-488306 Share on other sites More sharing options...
phppaper Posted March 10, 2008 Author Share Posted March 10, 2008 Thanks!! Link to comment https://forums.phpfreaks.com/topic/95322-mysql-empty-field-in-php/#findComment-488309 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.