qwe010 Posted September 25, 2006 Share Posted September 25, 2006 hi allI have a heavy scriptI think that the reason this code[quote]$Phpar=mysql_query("SELECT * FROM prog_script ") or die (mysql_error() );while($M=mysql_fetch_array($Phpar)){$file_name=$M["file_name"];$ID=$M["ID"];$file_wsf=$M["file_wsf"];$file_size=$M["file_size"];$file_ex=$M["file_ex"];$file2=$M["file2"];echo"<div align='center'> <center> <table border='1' cellspacing='1' width='100%' id='AutoNumber1' height='35'> <tr> <td width='16%' align='center' height='1'><span lang='en-us'> <font face='Tahoma' size='2' color='#800000'>$file_name</font></span></td> <td width='38%' align='center' height='1'><span lang='en-us'> <font face='Tahoma' size='2' color='#008080'>$file_wsf</font></span></td> <td width='10%' align='center' height='1'><span lang='en-us'> <font face='Tahoma' size='2' color='#000080'>$file_size</font></span></td> <td width='15%' align='center' height='1'><a href='$file_ex'> <img border='0' src='$file_ex' alt='ÇÖÛØ Úáì ÇáÕæÑÉ áÊßÈíÑåÇ' width='108' height='60'></a></td> <td width='11%' align='center' height='1'> <a href='download.php?file=http://{$HTTP_HOST}{$REQUEST_URI}$file2'> <img border='0' src='img/links.gif' width='20' height='20'></a></td> <td width='10%' align='center' height='1'><span lang='en-us'><font face='tahoma' size='2' font color='#ff0000' ><b><S CRIPT language='JavaScript' src='download.php?downloads=http://{$HTTP_HOST}{$REQUEST_URI}$file2'></S CRIPT></span></td> </tr>[/quote]How i can change it ?please Link to comment https://forums.phpfreaks.com/topic/21919-i-have-a-heavy-script/ Share on other sites More sharing options...
trq Posted September 25, 2006 Share Posted September 25, 2006 Well put it down before you hurt your back! :PSeriously though... do you have a question / problem what is it? Link to comment https://forums.phpfreaks.com/topic/21919-i-have-a-heavy-script/#findComment-97898 Share on other sites More sharing options...
qwe010 Posted September 25, 2006 Author Share Posted September 25, 2006 When I open page takes a very long time Show mistakes sometimes And sometimes don't works The number of loading times Link to comment https://forums.phpfreaks.com/topic/21919-i-have-a-heavy-script/#findComment-97913 Share on other sites More sharing options...
trq Posted September 25, 2006 Share Posted September 25, 2006 How many records does the query retrieve? Link to comment https://forums.phpfreaks.com/topic/21919-i-have-a-heavy-script/#findComment-97935 Share on other sites More sharing options...
qwe010 Posted September 26, 2006 Author Share Posted September 26, 2006 10$maxresults = 10;Why? What is the difference? Link to comment https://forums.phpfreaks.com/topic/21919-i-have-a-heavy-script/#findComment-98672 Share on other sites More sharing options...
qwe010 Posted September 26, 2006 Author Share Posted September 26, 2006 up ....... Link to comment https://forums.phpfreaks.com/topic/21919-i-have-a-heavy-script/#findComment-98880 Share on other sites More sharing options...
steveclondon Posted September 26, 2006 Share Posted September 26, 2006 don't see why it would be taking along time. looks ok to me. I take it you only have 10 records in the table as there is no where clause in the query.You say that sometimes it doesn't work, what is the error you get Link to comment https://forums.phpfreaks.com/topic/21919-i-have-a-heavy-script/#findComment-98882 Share on other sites More sharing options...
qwe010 Posted September 26, 2006 Author Share Posted September 26, 2006 my be Because i use this functions[code]<?php$version="v1.0";if(phpversion() >= "4.2.0"){ if(is_array($_SERVER)){ extract($_SERVER, EXTR_PREFIX_SAME, "server"); } if(is_array($_GET)){ extract($_GET, EXTR_PREFIX_SAME, "get"); } if(is_array($_POST)){ extract($_POST, EXTR_PREFIX_SAME, "post"); } if(is_array($_COOKIE)){ extract($_COOKIE, EXTR_PREFIX_SAME, "cookie"); } if(is_array($_FILES)){ extract($_FILES, EXTR_PREFIX_SAME, "file"); } if(is_array($_ENV)){ extract($_ENV, EXTR_PREFIX_SAME, "env"); } if(is_array($_REQUEST)){ extract($_REQUEST, EXTR_PREFIX_SAME, "request"); } if(is_array($_SESSION)){ extract($_SESSION, EXTR_PREFIX_SAME, "session"); }}class Mysql { var $mysql_username; var $mysql_password; var $mysql_db; var $mysql_host; var $result_id; var $link_id; var $dbconnect; var $num_rows; var $query_count=0; function Connect() { require("config.php"); $this->mysql_username=$mysql_username; $this->mysql_password=$mysql_password; $this->mysql_db=$mysql_db; $this->mysql_host=$mysql_host; $this->link_id=mysql_connect($this->mysql_host,$this->mysql_username,$this->mysql_password); if (!$this->link_id) { echo "Unable to connect to mysql server"; } $this->dbconnect=mysql_select_db($mysql_db); if (!$this->dbconnect) { echo "Unable to select database"; } return $this->link_id; } function Query($sql) { $this->result_id=mysql_query($sql) or die(mysql_error()); $this->query_count++; return $this->result_id; return $this->query_count; } function Num_rows() { $this->num_rows=mysql_num_rows($this->result_id); return $this->num_rows; } function Free_result() { mysql_free_result($this->result_id); } function Close() { mysql_close($this->link_id); }} function Naif() { }?>[/code] Link to comment https://forums.phpfreaks.com/topic/21919-i-have-a-heavy-script/#findComment-98902 Share on other sites More sharing options...
qwe010 Posted September 26, 2006 Author Share Posted September 26, 2006 up............. Link to comment https://forums.phpfreaks.com/topic/21919-i-have-a-heavy-script/#findComment-99292 Share on other sites More sharing options...
AndyB Posted September 26, 2006 Share Posted September 26, 2006 [quote author=qwe010 link=topic=109342.msg442067#msg442067 date=1159311025]up.............[/quote]If you want to provide more useful information, by all means do so. Bumping a thread isn't really helpful. If someone can work out how/if you can be helped, they'll find the thread.This sounds more like a crap[sup]TM[/sup] web host than a scripting problem given what you've explained. Link to comment https://forums.phpfreaks.com/topic/21919-i-have-a-heavy-script/#findComment-99308 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.