Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.