Jump to content

[SOLVED] pulling popular data from database


ccrevcypsys

Recommended Posts

so im having a problem getting this syntax to work properly

what i am trying to do is display the top 15 songs and when u scrollover the links of the song names that are pulled from the db it shows a title that displays there first and last name along with price pop and album name. all of these are in the same table except for firstName and lastName these are in the customer table.

 

its like this

cc_CubeCart_customer = firstName lastName

cc_CubeCart_inventory = popularity, albumName, image, name, price

here is the code i have made so far

$popularProds = $db->select("SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory WHERE deleted = 0 ORDER BY popularity DESC LIMIT 15");

This does not have the firstName and lastName so here is the one i tried but it messed the order up and just showed the same song over and over again

$popularProds = $db->select("SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory JOIN ".$glob['dbprefix']."CubeCart_customer WHERE deleted = 0 ORDER BY popularity DESC LIMIT 15");

 

 

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.