* Sunda Cyber Army 2k17 *
Indonesia Defacer ~
Results
<hr>
<?php
print_r($_REQUEST);
/*
Step 1: Create a database conection and save it ($mysql)
1a: Check if the db connection has an error
Step 2: Write a sql statement and store it ($sql)
Step 3: Submit the sql to the database connection, save the results ($results)
3b: Check if the results are bad.
Step 4: Loop through the results and output to the page.
*/
$genre = $_REQUEST["genre"];
echo "<br><br>" . $genre;
$dbname = "dent_dvd";
$dbserver= "wwebdev.iyaclasses.com";
$username = "dent";
$password = "sdsdsd";
include "../pdloginvariables.php";
$password = $userpw;
$mysql = new mysqli(
$dbserver,
$username,
$password,
$dbname
);
if($mysql->connect_errno){
echo "DATABASE ERROR" . $mysql->connect_error;
} else {
echo "DATABASE CONNECTION SUCCESSFUL";
}
/*
comment
*/
// single line comment
$sql = "SELECT * from movieView WHERE genre = '" . $genre . "'";
$results = $mysql->query($sql);
if(!$results) {
echo "<hr>ERROR: " . $mysql->error;
} else {
echo "<br><br>SQL SUCCESSFUL! of " . $sql . "<br><br>";
}
echo "<hr> " . $results->num_rows . " rows returns<br><br>";
while( $currentrow = $results->fetch_assoc() ){
echo $currentrow["title"] .
"( Rated " .
$currentrow["rating"] . ")<br>";
// print_r($currentrow);
}
// echo "<br><br>" . $sql;
?>