ok so in my script i have it connecting to forum_post3 times and someone told me that is why the forums are running so slow and they told me to use an array but im not too good with arrays how would i do that ...the connections are below just ask if you need me to place more code
$psql = mysql_query("SELECT *, FROM_UNIXTIME(timestamp+(60*60*$time), '%m/%d/%Y %h:%i %p') AS ts FROM forum_posts WHERE tid='$threadid' ORDER by timestamp ASC LIMIT 40");
$num = mysql_num_rows($psql);
$postcheck2 = mysql_query("SELECT username, FROM_UNIXTIME(timestamp+(3600*$time), '%m/%d/%Y %h:%i %p') AS ts FROM forum_posts WHERE tid='$thid' ORDER by timestamp DESC LIMIT 1") or die(mysql_error());
$postcheck = mysql_fetch_assoc($postcheck2);
$num2 = mysql_query("SELECT count(*) AS posts FROM forum_posts WHERE tid='$thid' AND username='$sessuser' LIMIT 40");
$num = mysql_fetch_assoc($num2);
$psql = mysql_query("SELECT *, FROM_UNIXTIME(timestamp+(60*60*$time), '%m/%d/%Y %h:%i %p') AS ts FROM forum_posts WHERE tid='$threadid' ORDER by timestamp ASC LIMIT 40");
$num = mysql_num_rows($psql);