Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
xGSTQ
Newbie
Newbie



Joined: Jun 13, 2006
Posts: 40

PostPosted: Thu Jun 29, 2006 11:54 am Reply with quote

Please first forgive me as i dont know which thread to post general php nuke assistants !!

im sure that you really dont need people like myself asking for normal everyday questions !! Very Happy

this is my small problem which im stuglling to get my head round ...

Im trying to make a small information list of total goods total catogories total themes from .... Digital Goods !! lol

This is what ive mannaged to do so far:

Code:
//start bottom information
// total catogories
$cnumrows = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_royal_membership_categories "));
//total goods
$cnumrows1 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_royal_memberships_downloads_deluxe "));   
//total gaming themes
$cnumrows2 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_royal_membership_categories "));
//total Clean Themes
$cnumrows3 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_royal_membership_categories "));
//build line of numbers         
$content .= "<center> Total Categories $cnumrows  | Total Goods $cnumrows1  | Total Gaming Themes $cnumrows2  | Total Clean Themes $cnumrows3</center>";   


Now the Total Goods Work And so does the Total Goods ... but i cant seem to get the sql correct for the total gaming /clean themes

the gaming themes and clean themes are apart of the _royal_membership_categories table i.e i have currently 10 catogories in that table and gaming themes is cid 10 in that sql table....

i cant seem to work out what code i would use to call that catogorie id inside the _royal_membership_categories

any help would be awsome !! ill keep playing

if you want to view it my site is http://udesign.me.uk and its the block "Our Products"

Thx Ped
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Thu Jun 29, 2006 11:40 pm Reply with quote

xGSTQ,

Unfortunately I am going to be away for awhile here shortly. It is usually best to post these types of general nuke questions at http://ravenphpscripts.com as there are several admins and moderators there to make sure you get a more timely and complete response.

I need to get back to packing and not sure when I will be able to get back to you. So, if you get an answer over at Raven's, please post back here as such as I won't be at Raven's much either (unless I steal some time away from family) and I may not know you already got an answer...

Regards,
montego

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Fri Jun 30, 2006 12:30 am Reply with quote

Got my packing done... I couldn't help myself.. Laughing

I have never used Digital Goods, so you will have to do a bit of "digging" into the category data, but I would have to guess that there are specific categories set up, one of them being "gaming themes". You need to add some kind of WHERE clause in your SQL to grab only those.

Are you sure _royal_membership_categories is the right table? Is EVERY gaming theme, along with other "goods", held in this table? If so, then it probably is the right table. However, it just seems strange to me that its called categories. Is there not a "Goods" table?

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
xGSTQ
Newbie
Newbie



Joined: Jun 13, 2006
Posts: 40

PostPosted: Fri Jun 30, 2006 2:45 am Reply with quote

Well thanks very much for helping , im sure your family should come first !! but i know how things can get addictive !!

All the 17 goods are listed in the table _royal_memberships_downloads_deluxe

and i see also in that table the same cid reflects the same as _royal_membership_categories

i sort of understand using WHERE as ive seen it in some code before but i dont know how to call the cid for those 2 catogories.

I really appriciate the help

Ped Smile
 
View user's profile Send private message
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Fri Jun 30, 2006 6:35 am Reply with quote

The syntax may not be correct but it should be something like
Code:
$cnumrows1 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_royal_memberships_downloads_deluxe" WHERE cid ="X"));   
//total gaming themes

In this example, you will need to find the cid (category ID) for your gaming themes and substitute 'X' for that number.
A google for 'mySQL SELECT WHERE' should give you the correct syntax or at least an understanding of why/how to use the WHERE clause.
 
View user's profile Send private message
xGSTQ
Newbie
Newbie



Joined: Jun 13, 2006
Posts: 40

PostPosted: Fri Jun 30, 2006 6:54 am Reply with quote

Awsome thank you ever so much, i removed a " and it worked just fine !!

here is the end code
Code:

//start bottom information
// total catogories
$cnumrows = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_royal_membership_categories "));
//total goods
$cnumrows1 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_royal_memberships_downloads_deluxe "));   
//total gaming themes
$cnumrows2 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_royal_memberships_downloads_deluxe  WHERE cid = 10 "));
//total Clean Themes
$cnumrows3 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_royal_memberships_downloads_deluxe  WHERE cid = 9 "));
//build line of numbers         
$content .= "<center> Total Categories $cnumrows  | Total Goods $cnumrows1  | Total Gaming Themes $cnumrows2  | Total Clean Themes $cnumrows3</center>";


obviously the 9 and 10 should be swapped around to which ever catogorie reflects your digital goods !!

Thanks Guardian and montego a great site and help to me !!
 
View user's profile Send private message
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Fri Jun 30, 2006 10:00 am Reply with quote

Thats fantastic you got it working.
Are you making this inot a block or something?
If you want me to host the download when you have finished I would be happy to oblige now that there is officially no support for E-Solution.
 
View user's profile Send private message
xGSTQ
Newbie
Newbie



Joined: Jun 13, 2006
Posts: 40

PostPosted: Fri Jun 30, 2006 10:37 am Reply with quote

I dont know if people would want it ?

here is a preview of the finished block, it was originally block-CenterGoodsall.php block.

ive made an RSS Feed so far for Digital Goods and redesigned this block.

the code submitted in question is highlighted in red in the preview below.

But ill zip it up the community is more than welcome to it

Image
 
View user's profile Send private message
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Fri Jun 30, 2006 10:52 am Reply with quote

Outstanding, well done.
When you get around to zipping it, send it to me at the address in my profile and I'll add it to my d/l section for you.
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch