mengedit fungsi.php

parent 9b38f4b6
......@@ -2,15 +2,15 @@
global $conn;
$conn = mysql_connect("127.0.0.1", "root", "", "p1d3ti08_proyek");
$conn = mysqli_connect("127.0.0.1", "root", "", "p1d3ti08_proyek");
if(!$conn){
die("database connect problem");
}
$db_use = mysql_select_db("p1d3ti08_proyek", $conn) or die ("select db problem!!");
$db_use = mysqli_select_db($conn, "p1d3ti08_proyek") or die ("select db problem!!");
function execQ($strQ){
global $conn;
$res = mysql_query($strQ, $conn);
$res = mysqli_query($conn, $strQ);
return $res;
}
......@@ -20,9 +20,9 @@ function getUser(){
$resItem = execQ($strQ);
if(mysql_num_rows($resItem)!=0){
if(mysqli_num_rows($resItem)!=0){
$ret = array();
while($data = mysql_fetch_assoc($resItem)){
while($data = mysqli_fetch_assoc($resItem)){
array_push($ret, array(
'id' => $data['id'],
'nama' => $data['namalengkap'],
......@@ -45,9 +45,9 @@ function getUser(){
$resItem = execQ($strQ);
if(mysql_num_rows($resItem)!=0){
if(mysqli_num_rows($resItem)!=0){
$ret = array();
while($data = mysql_fetch_assoc($resItem)){
while($data = mysqli_fetch_assoc($resItem)){
array_push($ret, array(
'id' => $data['ID'],
'nama_pengunjung' => $data['namapengunjung'],
......@@ -68,9 +68,9 @@ function getUser(){
$resItem = execQ($strQ);
if(mysql_num_rows($resItem)!=0){
if(mysqli_num_rows($resItem)!=0){
$ret = array();
while($data = mysql_fetch_assoc($resItem)){
while($data = mysqli_fetch_assoc($resItem)){
array_push($ret, array(
'id' => $data['id'],
'gambar' => $data['gambar'],
......@@ -89,9 +89,9 @@ function getUser(){
$resItem = execQ($strQ);
if(mysql_num_rows($resItem)!=0){
if(mysqli_num_rows($resItem)!=0){
$ret = array();
while($data = mysql_fetch_assoc($resItem)){
while($data = mysqli_fetch_assoc($resItem)){
array_push($ret, array(
'id' => $data['id'],
'nama' => $data['nama kamar'],
......@@ -115,9 +115,9 @@ function getUser(){
$resItem = execQ($strQ);
if(mysql_num_rows($resItem)!=0){
if(mysqli_num_rows($resItem)!=0){
$ret = array();
while($data = mysql_fetch_assoc($resItem)){
while($data = mysqli_fetch_assoc($resItem)){
array_push($ret, array(
'id' => $data['id'],
'namalengkap' => $data['namalengkap'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment