php - Woocommerce, How to Get image from Database -


i try put added product's image in slider. install woocommerce. write code image path database. take images sample image etc , return 403 forbidden error (http://localhost/projectname/wp-content/uploads/2014/06/screen-shot-2014-06-27-at-17.56.10.png%3cbr%3e ) 403 forbidden

so how can last added products image ?

here code

$sql = "select * wp_bapk_posts post_type = 'attachment' order `id` desc limit 4";                 mysql_select_db('houseok3_wor0879');                 $retval = mysql_query( $sql, $conn );                 if(! $retval )                 {                   die('could not data: ' . mysql_error());                 }                  while($row = mysql_fetch_array($retval, mysql_assoc))                 {                     $var = $row['id'];                     $sql2 = "select * wp_bapk_postmeta post_id = '".$var."' , meta_key = '_wp_attached_file' order `post_id` limit 4";                     mysql_select_db('houseok3_wor0879');                     $retval2 = mysql_query( $sql2, $conn );                     while($row2 = mysql_fetch_array($retval2, mysql_assoc))                     {                         $file = $row2['meta_value']."<br>";                         echo "<img src='wp-content/uploads/".$file."' alt=\"". $alt . "\" ".$imageaddparams. $kb_pz .">\n";                     }                 } 


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -