I was wondering by using which technique i can fetch data from database more fast...!!
.
.
i have 500 records and i have to do pagination also on it..!! how can i do it more faster...?
.
.
i just want to know what professionals do to make there application fast..!! :)
innocent.boys 0 Newbie Poster
SimonMayer 2 Junior Poster in Training
If, for example, you are using a MySQL database, often it will be down to the syntax of your MySQL query.
Perhaps you could select only the fields you need from the database
e.g. use "SELECT `name`, `age`, `address` FROM" instead of "SELECT * FROM". Using "SELECT *" to select everything will dramatically increase server load on large data sets.
If you would like to post your code on here, the people on this forum can probably take a look and offer some specific pointers.
sam023 0 Junior Poster
Use Xml instead of direct database..!!
tht will surely fasten ur application
innocent.boys 0 Newbie Poster
<?php
session_start();
include_once('session.php');
include_once('config.php');
$tariff_id = $_SESSION['tariff'] ;
if(isset($_POST['submit']) && $_POST['submit']!='')
{
$dial_prefix= $_POST['prefix'];
$query= "call view_card('$tariff_id','$dial_prefix')";
}
else
{
$query= "call sp_view_ratecard($tariff_id,'')";
}
$result = mysql_query($query) or die('query_error'.''.mysql_error());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Voip Billing</title>
<!-- CSS -->
<link rel="stylesheet" href="css/style.css" type="text/css" />
</head>
<body>
<div id="wrapper">
<!-- Header --><!-- Menu -->
<? include_once('menu.php'); ?>
<!-- Header end --> <!-- Menu end -->
<hr class="noscreen" />
<div id="content-box">
<form action="" name="form1" method="post">
<table align="center" width="100%" cellpadding="3" cellspacing="3">
<tr>
<td align="center" class="heading">View Tariff</td>
</tr>
<tr>
<td><hr><br></td>
</tr>
<tr>
<td align="center" valign="middle" class="text">Enter Dial Prfix
<input id='prefix' maxlength="8" onKeyUp="this.value=check(this.value);" value="<?=$_POST['prefix']; ?>" type='text' name='prefix'>
<input type='submit' onClick="return validate();" name='submit' value="submit"><br><br></td>
</tr>
<tr>
<tr valign="top">
<td height="350px" align="center">
<table align="center" border='1' width="700px" height='60px'>
<tr class="headingtext_n">
<td class="header">Sno.</td>
<td class="header">Prefix</td>
<td class="header">Destination</td>
<td class="header">Country Rates</td>
</tr>
<?
$counter=1;
$className="text";
while($row=mysql_fetch_row($result))
{ ?> <tr onMouseover="this.bgColor='yellow'"onMouseout="this.bgColor='#FFFFFF'" class="<?= $className; ?>">
<td align="center"><?= $counter ?></td>
<td align="right"><?= $row[0]; ?></td>
<td align="right"><?= $row[1]; ?></td>
<td align="right"><?= $row[2]; ?></td>
<? $counter=$counter+1;?>
</tr>
<?}?>
<tr class="headingtext_n">
<td class="header"> </td>
<td class="header"></td>
<td class="header"></td>
<td class="header"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<br />
<!-- Footer -->
<? include_once('footer.html'); ?>
<!-- Footer end -->
</div>
</body>
</html>
this is my code.. its very simple one..
I want to put pagination on it.. but i dont want to call procedure again and again.. by changing pages..!!!
how can i make it more fast and better..!! :)
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.