Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 134977

charismaarts on "help with $wpdb"

$
0
0

Hello All:

I have a query like this working fine in mysql:

$result = mysql_query("SELECT * FROM products WHERE prod_id = $prod_id");

while($row = mysql_fetch_array($result, MYSQL_BOTH))
{ $c66id = $row['c66_id'];
}

I am trying to do something similar with $wpdb; i know how to query it; but i cant figure out how to loop through results and put row values into variables like i did with the "while" statement above...

I can write a query like this on $wpdb:
$wpdb->query("SELECT * FROM products WHERE prod_id = $prod_id");

I just cant figure out how to make it loop through the rows...

can anyone help?

thanks, G


Viewing all articles
Browse latest Browse all 134977

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>