Jump to content

Query not working? No Error :: No Results


Perad

Recommended Posts

Hello, can someone explain to me why this query isn't working?

 

What I am trying to do is get the entire coupon table out.

 

Coupons are linked to companies via coupon.company + company.id

 

I am trying to get all coupons where a company begins with letter b.

 

What I think I am doing is this. Selecting all fields from the coupon table, selected data from coupons table, I am then joining the companies and coupons table with the company/id fields. I am then getting all results based on the company name. Obviously something is wrong. Could someone tell me what please.

 

SELECT `be_coupon`.`name`, `be_coupon`.`link`, `be_coupon`.`thumb`, `be_coupon`.`category`, `be_coupon`.`company`, `be_coupon`.`expires` FROM `be_coupon` JOIN `be_coupon_companies` ON `be_coupon_companies`.`id` = `be_coupon`.`company` WHERE `be_coupon_companies`.`name` LIKE '%b' 
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.