LemonInflux Posted November 27, 2007 Share Posted November 27, 2007 I have to questions; A) is '%' the mathematical symbol for 'is divisible by' in php? Say, if I put, if(10 % 2){ }, would that mean 'if 10 is divisible by 2, do this'? B) MySQL searches. How are they done? I recall something like "SELECT * FROM `table` WHERE `field` = '%value%'"; is that right? Thanks, Tom. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted November 27, 2007 Share Posted November 27, 2007 As for the query, it would be like this SELECT * FROM table WHERE field LIKE '%value%' I'm not going to comment on your first question as I don't know a ton about it. I believe you are correct though. Quote Link to comment Share on other sites More sharing options...
revraz Posted November 27, 2007 Share Posted November 27, 2007 A: Can probably find that answer in the Math forum B: http://www.sqlzoo.net/ Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 27, 2007 Share Posted November 27, 2007 $a % $b is known as Modulus, result is Remainder of $a divided by $b. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted November 27, 2007 Share Posted November 27, 2007 in Mysql when doing % like this: "SELECT * FROM `table` WHERE `column` LIKE '10%'" - That way makes a % a wild card Here are you modulo options: "SELECT MOD(234, 10)" "SELECT 253 % 7" "SELECT MOD(29,9)" "SELECT 29 MOD 9" Found: http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html 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.