Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with SQL Query


billybrag

Recommended Posts

Hello all,

im after some assistance with a fairly simply query.

 

Im working on a contribution that i will be releasing, hopefully in the next few weeks and i need a bit of help with a DB query

 

what i want to do is

 

select from customers where newsletter is true

 

then put those into a simple array

 

- can anyone help please?

 

 

thanks

"because it'll hurt more"- the greatest film of all time?

Link to comment
Share on other sites

Hello all,

im after some assistance with a fairly simply query.

 

Im working on a contribution that i will be releasing, hopefully in the next few weeks and  i need a bit of help with a DB query

 

what i want to do is

 

select from customers where newsletter is true

 

then put those into a simple array

 

- can anyone help please?

thanks

 

use something like this: (instead of the * list your columns needed)

 

$newsletter_query = tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");

 

while ($newsletter = tep_db_fetch_array($newsletter_query)) {

// do whatever you want to

}

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

use something like this: (instead of the * list your columns needed)

 

$newsletter_query = tep_db_query("select * from " . TABLE_CUSTOMERS . "  where customers_newsletter = '1'");

   

while ($newsletter = tep_db_fetch_array($newsletter_query)) {

// do whatever you want to

}

 

 

thanks ill give that a try :)

 

Mike

"because it'll hurt more"- the greatest film of all time?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...