{"absolute_url": "https://alexjosesilva.snipt.net/choose-com-procura-no-select-e-botao-cadastrar/", "blog_post": true, "code": "\n\n\n\n\n\n\t\n\t\tbselect\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n \t\t\n\n\t\n\t\n\t\t
\n\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\n\n\t\t\t
\n\n\n\n\t\t\t\n\t\t\t
\n\t\t\t
\n\n\t\t\t \n\t\t\t
\n\t\t\t
\n\t\t\t \t\n\t\t\t \t
\n\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t \n\t\t\t\t

Cadastrar Nova Entrada

\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t

Nome Pessoa

\n\t\t\t\t \n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t \t\n\t\t\t\t \n\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t \t
\n\t\t\t \n\n\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t
\n\n\t\n\n\n\n\n", "created": "2016-06-29T15:07:53.264653", "description": "Select com Botão Cadastrar. Conexão ao banco MySql. O botão Cadastrar chama um modal para cadastra o novo item e envia para o banco.", "description_rendered": "Select com Botão Cadastrar. Conexão ao banco MySql. O botão Cadastrar chama um modal para cadastra o novo item e envia para o banco.", "embed_url": "https://snipt.net/embed/058c07a1ccbeb45447c9596e4d921fcb/", "full_absolute_url": "https://alexjosesilva.snipt.net/choose-com-procura-no-select-e-botao-cadastrar/", "id": 147305, "lexer": "php", "line_count": 118, "log_entries": [{"code": "\n\n\n\n\n\n\t\n\t\tbselect\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n \t\t\n\n\t\n\t\n\t\t
\n\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\n\n\t\t\t
\n\n\n\n\t\t\t\n\t\t\t
\n\t\t\t
\n\n\t\t\t \n\t\t\t
\n\t\t\t
\n\t\t\t \n\t\t\t

Cadastrar Nova Entrada

\n\t\t\t
\n\t\t\t
\n\t\t\t

Nome Solicitante

\n\t\t\t \n\t\t\t
\n\t\t\t
\n\t\t\t \t\n\t\t\t \n\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t
\n\n\t\n", "created": "2016-06-29T15:07:53.286719", "diff": "--- \n+++ \n@@ -0,0 +1,82 @@\n+\n+\n+\n+\n+\n+\n+\t\n+\t\tbselect\n+\t\t\n+\n+\t\t\n+\t\t\n+\t\t\n+\t\t\n+\n+\t\t\n+\n+\t\t\n+\t\t\n+\t\t\n+\t\t\n+\t\t\n+ \t\t\n+\n+\t\n+\t\n+\t\t
\n+\n+\t\t\t\t
\n+\n+\t\t\t\t
\n+\t\t\t\t\t\n+\t\t\t\t\t\n+\t\t\t\t\t\n+\t\t\t\t
\n+\n+\n+\t\t\t
\n+\n+\n+\n+\t\t\t\n+\t\t\t
\n+\t\t\t
\n+\n+\t\t\t \n+\t\t\t
\n+\t\t\t
\n+\t\t\t \n+\t\t\t

Cadastrar Nova Entrada

\n+\t\t\t
\n+\t\t\t
\n+\t\t\t

Nome Solicitante

\n+\t\t\t \n+\t\t\t
\n+\t\t\t
\n+\t\t\t \t\n+\t\t\t \n+\t\t\t
\n+\t\t\t
\n+\n+\t\t\t
\n+\t\t\t
\n+\n+\t\n+", "user": "alexjosesilva"}, {"code": "\n\n\n\n\n\n\t\n\t\tbselect\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n \t\t\n\n\t\n\t\n\t\t
\n\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\n\n\t\t\t
\n\n\n\n\t\t\t\n\t\t\t
\n\t\t\t
\n\n\t\t\t \n\t\t\t
\n\t\t\t
\n\t\t\t \t\n\t\t\t \t
\n\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t \n\t\t\t\t

Cadastrar Nova Entrada

\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t

Nome Pessoa

\n\t\t\t\t \n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t \t\n\t\t\t\t \n\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t \t
\n\t\t\t \n\n\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t
\n\n\t\n\n\n\n\n", "created": "2016-06-30T20:41:57.480400", "diff": "--- \n+++ \n@@ -59,24 +59,59 @@\n \t\t\t
\n \t\t\t
\n \n-\t\t\t \n-\t\t\t
\n-\t\t\t
\n-\t\t\t \n-\t\t\t

Cadastrar Nova Entrada

\n-\t\t\t
\n-\t\t\t
\n-\t\t\t

Nome Solicitante

\n-\t\t\t \n-\t\t\t
\n-\t\t\t
\n-\t\t\t \t\n-\t\t\t \n-\t\t\t
\n-\t\t\t
\n+\t\t\t \n+\t\t\t
\n+\t\t\t
\n+\t\t\t \t\n+\t\t\t \t
\n+\t\t\t \t\t\n+\t\t\t \t\t\n+\t\t\t\t
\n+\t\t\t\t
\n+\t\t\t\t \n+\t\t\t\t

Cadastrar Nova Entrada

\n+\t\t\t\t
\n+\t\t\t\t
\n+\t\t\t\t

Nome Pessoa

\n+\t\t\t\t \n+\t\t\t\t
\n+\t\t\t\t
\n+\t\t\t\t \t\n+\t\t\t\t \n+\t\t\t\t
\n+\t\t\t\t
\n+\n+\t\t\t \t
\n+\t\t\t \n+\n+\t\t\t
\n+\t\t\t
\n \n \t\t\t
\n \t\t\t
\n \n \t\n-+\n+\n+\n+\n", "user": "alexjosesilva"}], "meta": null, "modified": "2016-12-24T16:56:31.700432", "publish_date": "2016-06-29T15:07:00", "raw_url": "/raw/058c07a1ccbeb45447c9596e4d921fcb/", "resource_uri": "/api/public/snipt/147305/", "slug": "choose-com-procura-no-select-e-botao-cadastrar", "stylized": "
  1\n  2\n  3\n  4\n  5\n  6\n  7\n  8\n  9\n 10\n 11\n 12\n 13\n 14\n 15\n 16\n 17\n 18\n 19\n 20\n 21\n 22\n 23\n 24\n 25\n 26\n 27\n 28\n 29\n 30\n 31\n 32\n 33\n 34\n 35\n 36\n 37\n 38\n 39\n 40\n 41\n 42\n 43\n 44\n 45\n 46\n 47\n 48\n 49\n 50\n 51\n 52\n 53\n 54\n 55\n 56\n 57\n 58\n 59\n 60\n 61\n 62\n 63\n 64\n 65\n 66\n 67\n 68\n 69\n 70\n 71\n 72\n 73\n 74\n 75\n 76\n 77\n 78\n 79\n 80\n 81\n 82\n 83\n 84\n 85\n 86\n 87\n 88\n 89\n 90\n 91\n 92\n 93\n 94\n 95\n 96\n 97\n 98\n 99\n100\n101\n102\n103\n104\n105\n106\n107\n108\n109\n110\n111\n112\n113\n114\n115\n116\n117
<?php\n\t$con=mysql_connect("localhost","root","") or die("Failed to connect with database!!!!");\n\n\tmysql_select_db("bancoteste", $con); \n\t$sth = mysql_query("SELECT * FROM linguagens");\n\n?>\n\n\n\n<!DOCTYPE html>\n<html>\n\t<head>\n\t\t<title>bselect</title>\n\t\t<meta charset="UTF-8" />\n\n\t\t<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css" />\n\t\t<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap-responsive.min.css" />\n\t\t<link rel="stylesheet/less" href="src/bselect.less" />\n\t\t<link rel="stylesheet" href="support/styles/prettify.css" />\n\n\t\t<!--[if lte IE 8]>\n\t\t<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>\n\t\t<![endif]-->\n\n\t\t<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/1.3.3/less.min.js"></script>\n\t\t<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>\n\t\t<script src="src/bselect.js"></script>\n\t\t<script src="support/scripts/prettify.js"></script>\n\t\t<script src="support/scripts/example.js"></script>\n  \t\t<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>\n\n\t</head>\n\t<body>\n\t\t<div class="container">\n\n\t\t\t\t<br>\n\n\t\t\t\t<div class="span6">\n\t\t\t\t\t<label for="bselect-standard">PHP:</label>\n\t\t\t\t\t\n\t\t\t\t\t<select class="languages span" id="bselect-standar">\n\t\t\t\t\t\t<option value="">Selecione</option>\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\twhile($r = mysql_fetch_assoc($sth)) {\n\t\t\t\t\t\t\t\t\techo "<option value='".$r['id']."'>".$r['tipo']."</option>";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t?> \n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\n\n\t\t\t</div>\n\n\n\n\t\t\t<!-- Modal -->\n\t\t\t<div id="myModal" class="modal fade" role="dialog">\n\t\t\t  <div class="modal-dialog">\n\n\t\t\t    <!-- Modal -->\n\t\t\t<div id="myModal" class="modal fade" role="dialog">\n\t\t\t  <div class="modal-dialog">\n\t\t\t  \t\n\t\t\t  \t<form action="enviar.php" method="post">\n\t\t\t  \t\t\n\t\t\t  \t\t<!-- Modal content-->\n\t\t\t\t    <div class="modal-content">\n\t\t\t\t      <div class="modal-header">\n\t\t\t\t        <button type="button" class="close" data-dismiss="modal">&times;</button>\n\t\t\t\t        <h4 class="modal-title">Cadastrar Nova Entrada</h4>\n\t\t\t\t      </div>\n\t\t\t\t      <div class="modal-body">\n\t\t\t\t        <p>Nome Pessoa</p>\n\t\t\t\t        <input type="text" name="nomePessoa" id="nomePessoa">\n\t\t\t\t      </div>\n\t\t\t\t      <div class="modal-footer">\n\t\t\t\t      \t<button type="submit" class="btn btn-success" >Save</button>\n\t\t\t\t        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>\n\t\t\t\t      </div>\n\t\t\t\t    </div>\n\n\t\t\t  \t</form>\n\t\t\t    \n\n\t\t\t  </div>\n\t\t\t</div>\n\n\t\t\t  </div>\n\t\t\t</div>\n\n\t</body>\n</html>\n\n\n<?php\n\n\t$nomePessoa = $_POST['nomePessoa'];\n\n\t$con=mysql_connect("localhost","root","") or die("Failed to connect with database!!!!");\n\n\tmysql_select_db("bancoteste", $con); \n\n\t$string = "INSERT INTO pessoa (nomePessoa) VALUES ('".$nomePessoa."')";\n\n\t$query = mysql_query($string);\n\n\tif($query == TRUE){\n\t\techo "Inserido com Sucesso";\n\t\thea[]\n\t}\n\telse{\n\t   echo "Erro ao inserir";\n\t}\n\n?>\n
\n
", "tags": [{"absolute_url": "/public/tag/jquery_4/", "id": 14772, "name": "Jquery", "resource_uri": "/api/public/tag/14772/", "snipts": "/api/public/snipt/?tag=14772"}, {"absolute_url": "/public/tag/mysql_3/", "id": 15524, "name": "MySql", "resource_uri": "/api/public/tag/15524/", "snipts": "/api/public/snipt/?tag=15524"}, {"absolute_url": "/public/tag/php_3/", "id": 16501, "name": "Php", "resource_uri": "/api/public/tag/16501/", "snipts": "/api/public/snipt/?tag=16501"}, {"absolute_url": "/public/tag/bootstrap_1/", "id": 29730, "name": "Bootstrap", "resource_uri": "/api/public/tag/29730/", "snipts": "/api/public/snipt/?tag=29730"}, {"absolute_url": "/public/tag/modal_1/", "id": 60786, "name": "Modal", "resource_uri": "/api/public/tag/60786/", "snipts": "/api/public/snipt/?tag=60786"}], "title": "Choose com Procura no Select e Botão Cadastrar", "user": {"absolute_url": "/alexjosesilva/", "email_md5": "aeee1adb46d99d6d54bb7b0d325a259f", "id": 18522, "resource_uri": "/api/public/user/18522/", "snipts": "/api/public/snipt/?user=18522", "snipts_count": 6, "username": "alexjosesilva"}}