Jump to content
php.lv forumi

INSERT PĀRBAUDE


Blink

Recommended Posts

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?

Link to comment
Share on other sites

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 by Blink
Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...