Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servidor = "localhost";
- $user = "root";
- $senha = "";
- $banco = "faculdadesbd";
- $mysqlli = new mysqli($servidor,$user,$senha,$banco);
- if(mysqli_connect_errno()) trigger_error(mysqli_connect_error());
- else
- echo "sucesso";
- @mysql_select_db("faculdadesbd",$mysqlli);
- ?>
- <html>
- <head>
- <title>Unigle</title>
- <style type="text/css">
- body{
- font-family:Verdana, Geneva, sans-serif;
- color:#333;
- font-size:12px;
- }
- </style>
- </head>
- <body>
- <form action="" method="post" name="buscador">
- <input type="text" name="busca"/>
- <input type="submit" name="botao" value="Pesquisar"/>
- </form>
- <br />
- <hr />
- <br />
- <?php
- if(isset($_POST['botao'])){
- $busca = $_POST['busca'];
- $busca_dividida = explode(' ',$busca);
- $quant = count($busca_dividida);
- for($i=0;$i<$quant;$i++){
- $pesquisa = $busca_dividida[$i];
- $sql = ("SELECT * FROM busca WHERE nome_fac LIKE '%$.pesquisa.%'");
- $query = $mysqli->query($sql);
- while($linha = $query->fetch_assoc()){
- $nome_fac = $linha['Nome'];
- $data_vest = $linha['Data Vestibular'];
- $data_taxa = $linha['Data Taxa'];
- $nota_corte = $linha['Nota de corte'];
- $nota_enem = $linha['Nota ENEM'];
- echo"
- <div class='resultado'>
- <h2>".$nome_fac."</h2>
- <p>".$data_vest."</p>
- <p>".$data_taxa."</p>
- <p>".$nota_corte."</p>
- <p>".$nota_enem."</p>
- </div>
- ";
- }
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement