Blink Posted March 17, 2012 Report Share Posted March 17, 2012 Sveiki, vai kāds varētu ieteikt , kā lai pārbauda lai kad cilvēks inserto kautko, viņš pieprasītu tikai ciparus nu teiksim ja sastāv no cipariem, viņš ievieto, ja no burtiem neievieto.. Mēģināju ar mediumint iekš type norādīt, viņš uzreiz pārvērš - uz "0" bet man tas neder.. Idejas? Quote Link to comment Share on other sites More sharing options...
rpr Posted March 17, 2012 Report Share Posted March 17, 2012 is_numeric() Quote Link to comment Share on other sites More sharing options...
Blink Posted March 17, 2012 Author Report Share Posted March 17, 2012 (edited) Tas izskatās šādi ? <?php function is_numeric($value) { return (preg_match ("/([0-9]*)/" ,$value) == 1); } ?> preg_match(mysql_query("INSERT INTO `kautkas` (`ids`) VALUES ('$ids')")); Edited March 17, 2012 by Blink Quote Link to comment Share on other sites More sharing options...
marcis Posted March 17, 2012 Report Share Posted March 17, 2012 Nē, tas izskatās kā is_numeric() Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.