Thread: Tech Dumb SQL question
View Single Post
Old 09-06-2015, 01:18 AM  
lezinterracial
Confirmed User
 
Industry Role:
Join Date: Jul 2012
Posts: 3,064
looks way better. SQLI isn't deprecated, right?
Code:
//SQL Connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 


$sql = "SELECT url, title FROM fappageinfo WHERE title LIKE '%{$searchstring}%' OR title LIKE '{$searchstring}%' ORDER BY dateadded DESC";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
      echo "<div>";
      echo "<a href=\"http://www.faprush.com/";
      echo $row['url'];
      echo "\"";
      echo " target=\"_blank\"";
      echo ">";
      echo $row['title'];
      echo "</a>";
      echo "</div>"; 
}
}

// Closing connection
$conn->close();
__________________
Live Sex Shows
lezinterracial is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote