On edit form accept id and character as primary key

Eg. http://example.org/articles/edit/5

this url fetch the record which has primary key 5, but in following url


this is also get same record but i pass primary key 5dsadasd.

Please tell me How to prevent them ??

ib db,

id colum is INT?
in cakephp did you create form, controller and model with cake bake tools?

yes column is int type.

I think you need to modify the routing for that like below:
$routes->connect(’/articles/edit/:id’, [‘controller’ => ‘Articles’,‘action’=>‘edit’],[‘id’ => ‘[0-9]’, ‘pass’ => [‘id’]]);

Try this and let me know is it working or not.