Jump to content

how to deal with large database?


zgkhoo

Recommended Posts

function setpyramidbonus($cardID,$pyrtable){

echo "</br>enter set pyramid bonus";
$result=mysql_query("SELECT * from $pyrtable ORDER BY PID");
while($row = mysql_fetch_array($result,MYSQL_ASSOC)){

	if($row[serialnum]==$cardID){
		echo "</br>row upline=".$row[uplineSerial];
		$levelcount=1;

		loopupline($row[uplineSerial],$levelcount,$cardID,$pyrtable);
	}

}

 

very slow n slow n slow for this funciton when the $pyrtable's record is too big which consist of above 10000 record..any solution to deal with large db?

thanks

Link to comment
Share on other sites

$sql = "CREATE TABLE pyrmain


		(
		PID integer(10),
		Serialnum varchar(10),
		UplineSerial varchar(10),
		UplinePID integer(10),
		Downleft integer(10),
		LeftSerial varchar(10),
		Downright integer(10),
		RightSerial varchar(10),
		RowNum integer(10),
		ColumnPosi integer(10),
		ColumnTotal integer(10),
		DownlineAmount integer(10),
		Initial varchar(10),
		ActivateTime datetime,
		Status varchar(10),
		UserID varchar(10),
		ExpiredDate datetime,
		CreateDate datetime,
		Golden varchar(10),

		Primary Key (PID)    	    
		)";
		mysql_query($sql);

table

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.