Jump to content

[SOLVED] Conformation and Searches


LemonInflux

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.