global $wpdb;
/* wpdb class should not be called directly.global $wpdb variable is an instantiation of the class already set up to talk to the WordPress database */

$result = $wpdb->get_results( “SELECT * FROM chains_details where chains_type_id=1 and chain_status=1″); /*mulitple row results can be pulled from the database with get_results function and outputs an object which is stored in $result */

//echo “

"; print_r($result); echo "

“;
/* If you require you may print and view the contents of $result object */
?>

Sterling Silver

Machine Made Chains

  • * Chains available in various length as per order
  • * Minimum Order 250 Grams each design
  • * All chains are with spring ring lock

Select products for there pricing and information

foreach($result as $row)
{
$c_id="product_" . $row->chains_id;
$c_name=$row->chains_name;
$c_code=$row->chains_code;
$c_length=$row->length_d;
$c_weight=$row->weight;
$c_size=$row->chains_size;
$c_image_name=$row->chains_images;
$c_image_path=$row->chains_path;

$c_name =str_replace(“\\”,”",$c_name);
$c_code =str_replace(“\\”,”",$c_code);
$c_size =str_replace(“\\”,”",$c_size);
$c_length =str_replace(“\\”,”",$c_length);
$c_weight =str_replace(“\\”,”",$c_weight);

$product_image=$c_image_path.$c_image_name;

$c_length_arr = split (“,”, $c_length);
$c_weight_arr = split (“,”, $c_weight);

?>

Code:
 

Length Weight
:
:
All Sizes are available
mm

}
/* Print the contents of $result looping through each row returned in the result */

?>

If any custom requirement or any other chain required.
Select products