Jump to content


Mr-Chidi

Member Since 20 May 2008
Offline Last Active Today, 12:36 AM

Posts I've Made

In Topic: Error 1064

16 December 2014 - 10:21 PM

mysql version is 5.6.17


In Topic: traversal tree / referal system

16 December 2014 - 09:57 PM

Switching your database to a nested set model may be beneficial. It makes it easier to query for things like the path to the root (ie, referral path) or tree depth (how many levels of referrals a person has).

It's a little more complex to manage and maintain, but tends to make working with the data more efficient and sometimes easier.

It may help to explain more specifically what kind of things you'd like to do. Like for example you say you want to award points. How exactly do you want to award points?

 

Hello.

 

The problem I'm having with the link you sent me is, how do they determine the left and right values? since i cannot just insert any value to them.

 

thanks


In Topic: traversal tree / referal system

15 December 2014 - 09:39 PM

Switching your database to a nested set model may be beneficial. It makes it easier to query for things like the path to the root (ie, referral path) or tree depth (how many levels of referrals a person has).

It's a little more complex to manage and maintain, but tends to make working with the data more efficient and sometimes easier.

It may help to explain more specifically what kind of things you'd like to do. Like for example you say you want to award points. How exactly do you want to award points?

Hi kicken. I've read the link you sent, i think changing to a nested set model will do the job, but how can i switch my database to a nested set model with my given fields or any other better way. Thanks


In Topic: traversal tree / referal system

12 December 2014 - 01:57 AM

Switching your database to a nested set model may be beneficial. It makes it easier to query for things like the path to the root (ie, referral path) or tree depth (how many levels of referrals a person has).

It's a little more complex to manage and maintain, but tends to make working with the data more efficient and sometimes easier.

It may help to explain more specifically what kind of things you'd like to do. Like for example you say you want to award points. How exactly do you want to award points?


How exactly do you want to award points?


for instance I give 4 points on first tree and 3points on second tree, 2points on third tree and above.

In Topic: Increment value based on condition

10 December 2014 - 12:22 PM

if you set up the unique composite index, the way i suggested, you don't need to query for anything or loop over anything. you just insert the data. if the client/provider pair doesn't exist, it gets inserted. if it already is in the table, it doesn't get inserted and produces a duplicate index error that you can choose to ignore in your error checking logic.

 

I f you could represent what you saying with example codes, it'll be better
 


Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com