/* * Slenderman * Connect to database * @ return bool (connection) */ function db_connect(){
$connection = ysqli_connect("localhost","slenderman","slenderman");
if(!$connection){
return false;
}
if (!mysqli_select_db($connection, "joblicious")) {
return false;
}
return $connection;
}
function find_jobs(){ db_connect();
$select = "SELECT jobs.id,
jobs.location,
jobs.title,
jobs.company,
jobs.description,
jobs.url";
$from = "FROM jobs.id";
$where ="WHERE jobs.id >0";
$query = $select.$from.$where;
$result = mysqli_query(db_connect(),$query);
while ($row = mysqli_fetch_array($result)){
echo $row['id'];
}
}
find_jobs();