-3
I took data from a table wp_posts and now I need to get data from the table wp_postmeta which coincide with the ID captured in the table wp_posts. These data are the product_img1, product_img2, product_img3 as shown in the image below:
The SQL I used to capture information from wp_posts is this:
<?php
require("configs/conxao.php");
$conectado = $pdo->query("SELECT * FROM wp_posts WHERE post_type = 'wpcproduct'");
$conectado->execute();
while($produtos = $conectado->fetch(PDO::FETCH_ASSOC)){
echo $produtos["ID"]."<br>";
echo $produtos["post_title"]."<br>";
}
?>
Can you help me finish this SQL?
http://imasters.com.br/artigo/240/sql-server/entendendo-joins/
– Caffé
http://answall.com/questions/6441/qual%C3%A9-a-difference%C3%A7a-entre-Inner-Join-e-outer-Join
– bfavaretto
I didn’t understand your edition, did you incorporate the answer in the question? With that, invalidated the answer that was given. If you have questions about what the answer suggests, use the comments below it. I will reverse the edit.
– bfavaretto
Could connect directly to WP and use native functions.
– brasofilo
You can help me with this @Brasofilo?
– Marcos Vinicius
And actually, the best thing is for you to tell us what problem you’re trying to solve, not just the problem you have with the code. So you can answer with precision.
– brasofilo