Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: What's the difference between '%s' and '%d' in MySQL statements?


daan77
Participant

@daan77

it’s for php to know how to handle the parameters,

%d – the argument is treated as an integer, and presented as a (signed) decimal number.

%s – the argument is treated as and presented as a string.

in your examples, $slug is a string and $this->id is an integer

look at http://www.php.net/manual/en/function.sprintf.php for more info

Skip to toolbar