aeroswat Posted March 3, 2010 Share Posted March 3, 2010 If I put this SELECT * FROM tbl WHERE SUBSTR(field,4) = ''; Would it work if there aren't 4 characters in the string or would it be NULL? Link to comment https://forums.phpfreaks.com/topic/194008-what-will-the-mysql-substr-function-return-if/ Share on other sites More sharing options...
jtgraphic Posted March 3, 2010 Share Posted March 3, 2010 It will return the whole field. i.e. the word "can" will return "can". Link to comment https://forums.phpfreaks.com/topic/194008-what-will-the-mysql-substr-function-return-if/#findComment-1020938 Share on other sites More sharing options...
aeroswat Posted March 3, 2010 Author Share Posted March 3, 2010 It will return the whole field. i.e. the word "can" will return "can". So any number past the length as a starting position will automatically return the whole word? That seems like a bad idea O_o Link to comment https://forums.phpfreaks.com/topic/194008-what-will-the-mysql-substr-function-return-if/#findComment-1020944 Share on other sites More sharing options...
jtgraphic Posted March 3, 2010 Share Posted March 3, 2010 Oh, wait I misread that - sorry. It will return null. Link to comment https://forums.phpfreaks.com/topic/194008-what-will-the-mysql-substr-function-return-if/#findComment-1020958 Share on other sites More sharing options...
aeroswat Posted March 3, 2010 Author Share Posted March 3, 2010 Oh, wait I misread that - sorry. It will return null. I c. Thank you Link to comment https://forums.phpfreaks.com/topic/194008-what-will-the-mysql-substr-function-return-if/#findComment-1020972 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.