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
https://forums.phpfreaks.com/topic/78754-how-to-deal-with-large-database/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.