Advertisement
Guest User

display.php

a guest
Jul 13th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2. $tipp = $_GET["timm"];// Connects to your Database mysql_connect("localhost","username","password")ordie(mysql_error());
  3. mysql_select_db("database name")ordie(mysql_error());// SQL query $strSQL ="SELECT * FROM wp_posts WHERE post_mime_type LIKE 'image/jpeg' AND post_date > '$tipp' ORDER BY `wp_posts`.`id` DESC LIMIT 10";// Execute the query (the recordset $rs contains the result) $rs = mysql_query($strSQL);// Loop the recordset $rs// Each row will be made into an array ($row) using mysql_fetch_arraywhile($row = mysql_fetch_array($rs)){//guid is the column where the image url is located in the wordpress database table $atime = $row['guid']; echo "<img src='". $atime ."' /><br />";}// Close the database connection mysql_close();?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement