Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PSW_II_PARIWISATA_TRANSPORTASI
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Proyek_PSW_II_PARIWISATA
PSW_II_PARIWISATA_TRANSPORTASI
Commits
9fd929da
Commit
9fd929da
authored
Jun 06, 2020
by
11319009_Pratiwi Sibarani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
3c2e15bd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
dbconfig.php
transportasi/common/dbconfig.php
+44
-0
No files found.
transportasi/common/dbconfig.php
0 → 100644
View file @
9fd929da
<?php
// include_once("../config.php")
$host
=
"localhost"
;
$user
=
"root"
;
$pass
=
""
;
$db
=
"transportasidb"
;
$koneksi
=
mysqli_connect
(
$host
,
$user
,
$pass
,
$db
);
function
query
(
$query
)
{
global
$koneksi
;
$result
=
mysqli_query
(
$koneksi
,
$query
);
$rows
=
[];
///siapkan kotak untuk naruh baju analogi
while
(
$row
=
mysqli_fetch_assoc
(
$result
))
{
$rows
[]
=
$row
;
}
return
$rows
;
}
if
(
!
$koneksi
){
die
(
"Koneksi gagal: "
.
mysqli_connect_eror
());
}
function
register
(
$data
){
global
$koneksi
;
// get data
$nama
=
htmlspecialchars
(
$data
[
"nama"
]);
$email
=
htmlspecialchars
(
$data
[
"email"
]);
$alamat
=
htmlspecialchars
(
$data
[
"alamat"
]);
$j_kelamin
=
htmlspecialchars
(
$data
[
"j_kelamin"
]);
$username
=
htmlspecialchars
(
$data
[
"username"
]);
$password
=
htmlspecialchars
(
$data
[
"password"
]);
$role
=
"user"
;
// query
$query
=
"INSERT INTO log_akun VALUES ('','
$nama
','
$email
','
$alamat
','
$j_kelamin
','
$username
','
$password
','
$role
')"
;
mysqli_query
(
$koneksi
,
$query
);
return
mysqli_affected_rows
(
$koneksi
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment