Jump to content

Looping trough an array, for a sql query?


CSkovholm

Recommended Posts

Hey guys :)

 

I have an array with 3 ids. 20, 13 and 1. I now want to create a sql query, that uses the "WHERE id IN ()".. But how do i store the array, into the sql query? Something like "SELECT * FROM blabla WHERE id IN (".$array.")", however, i know you have to loop trough the array to output the values.. But how is this done?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/199689-looping-trough-an-array-for-a-sql-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.