Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $tipp = $_GET["timm"];// Connects to your Database mysql_connect("localhost","username","password")ordie(mysql_error());
- 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