Skip to content

Commit

Permalink
Resolvendo problema conexao db
Browse files Browse the repository at this point in the history
  • Loading branch information
sukuasoft committed Nov 2, 2023
1 parent 77cedf0 commit 7ed0c56
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conexao.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
$host='Localhost';
$host='localhost';
$username='root';
$dbname='turmas';
$password='';

$conexao = new mysqli($host,$username,$dbname,$password);
$conexao = new mysqli($host,$username,$password,$dbname);


if ($conexao->connect_errno){
Expand Down
15 changes: 15 additions & 0 deletions db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
create database turmas;

use turmas;

create table sala10 (
nome varchar(25) not null,
sobrenome varchar(25) not null,
idade int not null,
numero int not null,
sexo char(1) not null
);

insert into sala10 values ('Pedro', 'Lucas', 18, 1, 'M');
insert into sala10 values ('Jõao', 'Salvador', 19, 2, 'M');
insert into sala10 values ('Maria', 'Salvador', 19, 3, 'F');

0 comments on commit 7ed0c56

Please sign in to comment.