* Sunda Cyber Army 2k17 *
Indonesia Defacer ~
<?php
$host = "webdev.iyaserver.com";
$userid = "[youruserid]";
$userpw = "[yourpw]";
$db = "[database name]";
include '../pdloginvariables.php';
$mysql = new mysqli(
$host,
$userid,
$userpw,
$db
);
if($mysql->connect_errno) {
echo "db connection error : " . $mysql->connect_error;
exit();
} else {
echo "db connection success!<br><br>";
}
/*$conn = mysqli_connect(
"acad.itpwebdev.com",
$userid,
$userpw,
"dent_dvd");
if(mysqli_connect_errno()) {
echo "Failed to connect to mySql with userID " . $userid .
"received error: " . mysqli_connect_errno();
exit();
}
echo "connection success! ";
$results = mysqli_query($conn, $sql);
if(!$results) {
exit("SQL Error: " . mysqli_error($conn));
}
*/
$sql = "
SELECT * from movieView
WHERE title LIKE '%" . $_REQUEST['title'] . "%'";
/* write SQL command, store in variable for ease of use */
echo "<hr> sql submitted:<br>" . $sql . "<hr>";
$results = $mysql->query($sql);
if(!$results) {
echo "SQL error: ". $mysql->error;
exit();
} else {
echo "all good... here come the results...<br><br>";
}
echo $results->num_rows . " records returned!<br><br>";
$row = $results->fetch_assoc();
echo $row["title"] . "<br>";
while($currentrow = $results->fetch_assoc()) {
echo $currentrow["title"]. "<br>";
}
exit();
echo "<br><br>";
echo "You were searching for the genre <strong>" . $_REQUEST['genre'] . "</strong>. ";
echo "There were " . mysqli_num_rows($results) . " matching records.<hr>";
?>
<style>
.title {
width: 600px;
float: left;
font-weight: bold;
background-color: yellow;
}
.rating {
width: 100px;
float: left;
font-style: italic;
background-color: aliceblue;
text-align: center;
}
.label {
width: 300px;
float: left;
background-color: azure;
}
</style>
<div class="title">Title:<hr></div>
<div class="rating">Rating:<hr></div>
<div class="label">Label::<hr></div>
<br style="clear:both;">
<?php
while($currentrow = mysqli_fetch_array($results)) { // loop has started
?>
<div class="title">
<?php echo $currentrow['title']; ?>
</div>
<div class="rating">
<?php echo $currentrow['rating']; ?>
</div>
<div class="label">
<?php echo $currentrow['label']; ?>
</div>
<br style="clear:both;">
<?php
} // end loop
?>
}
<?php
/*
while($currentrow = mysqli_fetch_array($results)) {
echo '<div class="title">' . $currentrow['title'] . '</div>';
echo '<div class="rating">Rated ' . $currentrow['rating'] . '</div>';
echo '<div class="label">' . $currentrow['label'] . '</div>';
echo '<br style="clear:both;">';
}
*/