How to limit a user to entering 10 keywords or less using PHP & MySQL? -


I am trying to limit my users to enter at least 10 keywords and wondered How can i do this PHP & amp; MySQL with your current keyword script?

Here are the keyword AdWords MySQL code. If (isset ($ _ POST ['tag']) & amp; ($ _POST ['tag'])! == '') {$ Tag = Explosion (" , ", $ _POST ['tag']); ($ X = 0; $ x & lt; Count ($ tag); $ x ++) {$ mysqli = mysqli_connect ("localhost", "root", "", "cite name"); Include $ Query1 = "tag values ​​('.' Mysqli_real_escape_string ($ mysqli, strtolower (htmlentities (trim (strip_tags ($ tag [$ x])))). '' ''); If (! Mysqli_query ($ mysqli, $ query1)) {print mysqli_error ($ mysqli); Return; } $ Mysqli = mysqli_connect ("localhost", "root", "", "sitename"); $ Dbc = mysqli_query ($ mysqli, "tags to select tag = '" .mysqli_real_escape_string ($ mysqli, strtolower (htmlentities (trim (strip_tags ($ tag [$ x]))))) ";); if {$ $ Dbc} {print mysqli_error ($ mysqli);} and {while ($ line = mysqli_fetch_array ($ dbc)) {$ id = $ row ["id"];}} $ Query2 = "question_tag (tag_ id, question_id , User_id, date_credited) values ​​('$ id', '$ question', '$ user', now ());;; (! Mysqli_query ($ mysqli, $ query2)) {print mysqli_error ($ mysqli); return; }}}}

quick and dirty without verification:

  // ... for ($ x = 0; $ X & lt; min (count ($ Tag), 10); $ x ++) {// ...  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -