mengedit fungsi.php

parent 9b38f4b6
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
global $conn; global $conn;
$conn = mysql_connect("127.0.0.1", "root", "", "p1d3ti08_proyek"); $conn = mysqli_connect("127.0.0.1", "root", "", "p1d3ti08_proyek");
if(!$conn){ if(!$conn){
die("database connect problem"); 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){ function execQ($strQ){
global $conn; global $conn;
$res = mysql_query($strQ, $conn); $res = mysqli_query($conn, $strQ);
return $res; return $res;
} }
...@@ -20,9 +20,9 @@ function getUser(){ ...@@ -20,9 +20,9 @@ function getUser(){
$resItem = execQ($strQ); $resItem = execQ($strQ);
if(mysql_num_rows($resItem)!=0){ if(mysqli_num_rows($resItem)!=0){
$ret = array(); $ret = array();
while($data = mysql_fetch_assoc($resItem)){ while($data = mysqli_fetch_assoc($resItem)){
array_push($ret, array( array_push($ret, array(
'id' => $data['id'], 'id' => $data['id'],
'nama' => $data['namalengkap'], 'nama' => $data['namalengkap'],
...@@ -45,9 +45,9 @@ function getUser(){ ...@@ -45,9 +45,9 @@ function getUser(){
$resItem = execQ($strQ); $resItem = execQ($strQ);
if(mysql_num_rows($resItem)!=0){ if(mysqli_num_rows($resItem)!=0){
$ret = array(); $ret = array();
while($data = mysql_fetch_assoc($resItem)){ while($data = mysqli_fetch_assoc($resItem)){
array_push($ret, array( array_push($ret, array(
'id' => $data['ID'], 'id' => $data['ID'],
'nama_pengunjung' => $data['namapengunjung'], 'nama_pengunjung' => $data['namapengunjung'],
...@@ -68,9 +68,9 @@ function getUser(){ ...@@ -68,9 +68,9 @@ function getUser(){
$resItem = execQ($strQ); $resItem = execQ($strQ);
if(mysql_num_rows($resItem)!=0){ if(mysqli_num_rows($resItem)!=0){
$ret = array(); $ret = array();
while($data = mysql_fetch_assoc($resItem)){ while($data = mysqli_fetch_assoc($resItem)){
array_push($ret, array( array_push($ret, array(
'id' => $data['id'], 'id' => $data['id'],
'gambar' => $data['gambar'], 'gambar' => $data['gambar'],
...@@ -89,9 +89,9 @@ function getUser(){ ...@@ -89,9 +89,9 @@ function getUser(){
$resItem = execQ($strQ); $resItem = execQ($strQ);
if(mysql_num_rows($resItem)!=0){ if(mysqli_num_rows($resItem)!=0){
$ret = array(); $ret = array();
while($data = mysql_fetch_assoc($resItem)){ while($data = mysqli_fetch_assoc($resItem)){
array_push($ret, array( array_push($ret, array(
'id' => $data['id'], 'id' => $data['id'],
'nama' => $data['nama kamar'], 'nama' => $data['nama kamar'],
...@@ -115,9 +115,9 @@ function getUser(){ ...@@ -115,9 +115,9 @@ function getUser(){
$resItem = execQ($strQ); $resItem = execQ($strQ);
if(mysql_num_rows($resItem)!=0){ if(mysqli_num_rows($resItem)!=0){
$ret = array(); $ret = array();
while($data = mysql_fetch_assoc($resItem)){ while($data = mysqli_fetch_assoc($resItem)){
array_push($ret, array( array_push($ret, array(
'id' => $data['id'], 'id' => $data['id'],
'namalengkap' => $data['namalengkap'], '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