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. Link to comment https://forums.phpfreaks.com/topic/79107-solved-conformation-and-searches/ 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. Link to comment https://forums.phpfreaks.com/topic/79107-solved-conformation-and-searches/#findComment-400346 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/ Link to comment https://forums.phpfreaks.com/topic/79107-solved-conformation-and-searches/#findComment-400347 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. Link to comment https://forums.phpfreaks.com/topic/79107-solved-conformation-and-searches/#findComment-400350 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 Link to comment https://forums.phpfreaks.com/topic/79107-solved-conformation-and-searches/#findComment-400392 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.