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 Quote Link to comment 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')"); Quote Link to comment 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. Quote Link to comment 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?? Quote Link to comment Share on other sites More sharing options...
Nuv Posted March 10, 2008 Share Posted March 10, 2008 Thats field has a name? Quote Link to comment 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" Quote Link to comment 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' "; Quote Link to comment Share on other sites More sharing options...
phppaper Posted March 10, 2008 Author Share Posted March 10, 2008 Thanks!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.