Jump to content

Archived

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

qwe010

I have a heavy script ?

Recommended Posts

hi all

I have a heavy script

I 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

Share this post


Link to post
Share on other sites
Well put it down before you hurt your back! :P

Seriously though... do you have a question / problem what is it?

Share this post


Link to post
Share on other sites
When I open page takes a very long time    Show mistakes sometimes   

And sometimes don't works      The number of loading times

Share this post


Link to post
Share on other sites
How many records does the query retrieve?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
[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.

Share this post


Link to post
Share on other sites

×

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.