Jump to content

Recommended Posts

I know i should be posting this in mysql or something but there is no one there so ya...

 

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
https://forums.phpfreaks.com/topic/68094-solved-database-pull-problems/
Share on other sites

well did u mean

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

because this is what that one does

dtm.gif

and they all have random names. it should look like this

dtm1.gif

with the names of course in the yellow thing...

i dont understand this well enough to even guess.

is this closer?

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

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.