Re: showing warnings

Re: showing warnings

am 09.09.2007 15:43:07 von John Mertic

Can you provide the script you are running and the exact error message
you are getting?

John

On 9/9/07, Asim wrote:
> Hi
>
>
> in my script when i scan whole table for result set to display in my page it shows warning that suggest me to use
>
>
> EXPLAIN statement but i donot need it as i have to show records on page
>
> how to avoid this warning?
>
> Bye
>
>
>
>
>
>
>
>
> Asim Jamil - 0092 345 4025907, Pakistan
>
> ---------------------------------
> Be a better Globetrotter. Get better travel answers from someone who knows.
> Yahoo! Answers - Check it out.


--
--
John Mertic "Explaining a joke
is like dissecting a frog: you
jmertic@gmail.com understand it better,
but the frog dies in the
process."

-Mark Twain

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: showing warnings

am 10.09.2007 15:22:04 von Asim

--0-5874514-1189430524=:3606
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi

script is following

if(isset($_GET['SearchTune']))
{
$tunename = substr($_GET['tune_name'],0,3);
$tunetype = $_GET['tune_type'];
$sql = "SELECT Tune_Name,Tune_Type FROM Mobile_Tunes WHERE Tune_Name LIKE '".$tunename."%' AND Tune_Type = '".$tunetype."'";
}
else
{
$sql = "SELECT Tune_Name,Tune_Type FROM Mobile_Tunes";
}

............................................................ ...............

function max_page($sql,$total_rows,$rows_per_page,$max_pages)
{
$all_rs = mysql_query($sql);
if(!$all_rs)
{
echo "Sorry! Try again.";
return false;
}
$total_rows = mysql_num_rows($all_rs);
mysql_free_result($all_rs);
//mysql_close($link);
$max_pages = ceil($total_rows/$rows_per_page);
return $max_pages;
}


when i use this function it shows following warning

Warning: mysql_query(): Your query requires a full tablescan (table Mobile_Tunes, 5 rows affected). Use EXPLAIN to optimize your query. in D:\Program Files\Apache Group\Apache2\htdocs\Breez\mtunes_main.php on line 47



now can you tell me some solution

bye













John Mertic wrote:
Can you provide the script you are running and the exact error message
you are getting?

John

On 9/9/07, Asim wrote:
> Hi
>
>
> in my script when i scan whole table for result set to display in my page it shows warning that suggest me to use
>
>
> EXPLAIN statement but i donot need it as i have to show records on page
>
> how to avoid this warning?
>
> Bye
>
>
>
>
>
>
>
>
> Asim Jamil - 0092 345 4025907, Pakistan
>
> ---------------------------------
> Be a better Globetrotter. Get better travel answers from someone who knows.
> Yahoo! Answers - Check it out.


--
--
John Mertic "Explaining a joke
is like dissecting a frog: you
jmertic@gmail.com understand it better,
but the frog dies in the
process."

-Mark Twain

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Asim Jamil - 0092 345 4025907, Pakistan

---------------------------------
Be a better Heartthrob. Get better relationship answers from someone who knows.
Yahoo! Answers - Check it out.
--0-5874514-1189430524=:3606--

Re: showing warnings

am 10.09.2007 15:25:05 von John Mertic

Is the table 'Mobile_Tunes' indexed at all? If not, you may want to
consider adding one at least one 'Tune_Type' and another on
'Tune_Name'.

John

On 9/10/07, Asim wrote:
> Hi
>
> script is following
>
> if(isset($_GET['SearchTune']))
> {
> $tunename = substr($_GET['tune_name'],0,3);
> $tunetype = $_GET['tune_type'];
> $sql = "SELECT Tune_Name,Tune_Type FROM Mobile_Tunes WHERE Tune_Name LIKE
> '".$tunename."%' AND Tune_Type = '".$tunetype."'";
> }
> else
> {
> $sql = "SELECT Tune_Name,Tune_Type FROM Mobile_Tunes";
> }
>
> ............................................................ ...............
>
> function
> max_page($sql,$total_rows,$rows_per_page,$max_pages)
> {
> $all_rs = mysql_query($sql);
> if(!$all_rs)
> {
> echo "Sorry! Try again.";
> return false;
> }
> $total_rows = mysql_num_rows($all_rs);
> mysql_free_result($all_rs);
> //mysql_close($link);
> $max_pages = ceil($total_rows/$rows_per_page);
> return $max_pages;
> }
>
>
> when i use this function it shows following warning
>
> Warning: mysql_query(): Your query requires a full tablescan (table
> Mobile_Tunes, 5 rows affected). Use EXPLAIN to optimize your query. in
> D:\Program Files\Apache
> Group\Apache2\htdocs\Breez\mtunes_main.php on line 47
>
>
>
> now can you tell me some solution
>
> bye
>
>
>
>
>
>
>
>
>
>
>
>
>
> John Mertic wrote:
> Can you provide the script you are running and the exact error message
> you are getting?
>
> John
>
> On 9/9/07, Asim wrote:
> > Hi
> >
> >
> > in my script when i scan whole table for result set to display in my page
> it shows warning that suggest me to use
> >
> >
> > EXPLAIN statement but i donot need it as i have to show records on page
> >
> > how to avoid this warning?
> >
> > Bye
> >
> >
> >
> >
> >
> >
> >
> >
> > Asim Jamil - 0092 345 4025907, Pakistan
> >
> > ---------------------------------
> > Be a better Globetrotter. Get better travel answers from someone who
> knows.
> > Yahoo! Answers - Check it out.
>
>
> --
> --
> John Mertic "Explaining a joke
> is like dissecting a frog: you
> jmertic@gmail.com understand it better,
> but the frog dies in the
> process."
>
> -Mark Twain
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> Asim Jamil - 0092 345 4025907, Pakistan
>
> ________________________________
> Be a better Heartthrob. Get better relationship answers from someone who
> knows.
> Yahoo! Answers - Check it out.
>
>


--
--
John Mertic "Explaining a joke
is like dissecting a frog: you
jmertic@gmail.com understand it better,
but the frog dies in the
process."

-Mark Twain

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: showing warnings

am 10.09.2007 15:48:43 von Asim

--0-210817412-1189432123=:34225
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi

i have added index on both columns but still same warning is issued by mysql

then what i do now

John Mertic wrote:
Is the table 'Mobile_Tunes' indexed at all? If not, you may want to
consider adding one at least one 'Tune_Type' and another on
'Tune_Name'.

John

On 9/10/07, Asim wrote:
> Hi
>
> script is following
>
> if(isset($_GET['SearchTune']))
> {
> $tunename = substr($_GET['tune_name'],0,3);
> $tunetype = $_GET['tune_type'];
> $sql = "SELECT Tune_Name,Tune_Type FROM Mobile_Tunes WHERE Tune_Name LIKE
> '".$tunename."%' AND Tune_Type = '".$tunetype."'";
> }
> else
> {
> $sql = "SELECT Tune_Name,Tune_Type FROM Mobile_Tunes";
> }
>
> ............................................................ ...............
>
> function
> max_page($sql,$total_rows,$rows_per_page,$max_pages)
> {
> $all_rs = mysql_query($sql);
> if(!$all_rs)
> {
> echo "Sorry! Try again.";
> return false;
> }
> $total_rows = mysql_num_rows($all_rs);
> mysql_free_result($all_rs);
> //mysql_close($link);
> $max_pages = ceil($total_rows/$rows_per_page);
> return $max_pages;
> }
>
>
> when i use this function it shows following warning
>
> Warning: mysql_query(): Your query requires a full tablescan (table
> Mobile_Tunes, 5 rows affected). Use EXPLAIN to optimize your query. in
> D:\Program Files\Apache
> Group\Apache2\htdocs\Breez\mtunes_main.php on line 47
>
>
>
> now can you tell me some solution
>
> bye
>
>
>
>
>
>
>
>
>
>
>
>
>
> John Mertic wrote:
> Can you provide the script you are running and the exact error message
> you are getting?
>
> John
>
> On 9/9/07, Asim wrote:
> > Hi
> >
> >
> > in my script when i scan whole table for result set to display in my page
> it shows warning that suggest me to use
> >
> >
> > EXPLAIN statement but i donot need it as i have to show records on page
> >
> > how to avoid this warning?
> >
> > Bye
> >
> >
> >
> >
> >
> >
> >
> >
> > Asim Jamil - 0092 345 4025907, Pakistan
> >
> > ---------------------------------
> > Be a better Globetrotter. Get better travel answers from someone who
> knows.
> > Yahoo! Answers - Check it out.
>
>
> --
> --
> John Mertic "Explaining a joke
> is like dissecting a frog: you
> jmertic@gmail.com understand it better,
> but the frog dies in the
> process."
>
> -Mark Twain
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> Asim Jamil - 0092 345 4025907, Pakistan
>
> ________________________________
> Be a better Heartthrob. Get better relationship answers from someone who
> knows.
> Yahoo! Answers - Check it out.
>
>


--
--
John Mertic "Explaining a joke
is like dissecting a frog: you
jmertic@gmail.com understand it better,
but the frog dies in the
process."

-Mark Twain

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Asim Jamil - 0092 345 4025907, Pakistan

---------------------------------
Boardwalk for $500? In 2007? Ha!
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
--0-210817412-1189432123=:34225--

Re: showing warnings

am 10.09.2007 15:50:52 von Asim

--0-1448636462-1189432252=:54613
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi

i have added index on both columns but still same warning is issued by mysql

then what i do now?

BYE







John Mertic wrote:
Is the table 'Mobile_Tunes' indexed at all? If not, you may want to
consider adding one at least one 'Tune_Type' and another on
'Tune_Name'.

John

On 9/10/07, Asim wrote:
> Hi
>
> script is following
>
> if(isset($_GET['SearchTune']))
> {
> $tunename = substr($_GET['tune_name'],0,3);
> $tunetype = $_GET['tune_type'];
> $sql = "SELECT Tune_Name,Tune_Type FROM Mobile_Tunes WHERE Tune_Name LIKE
> '".$tunename."%' AND Tune_Type = '".$tunetype."'";
> }
> else
> {
> $sql = "SELECT Tune_Name,Tune_Type FROM Mobile_Tunes";
> }
>
> ............................................................ ...............
>
> function
> max_page($sql,$total_rows,$rows_per_page,$max_pages)
> {
> $all_rs = mysql_query($sql);
> if(!$all_rs)
> {
> echo "Sorry! Try again.";
> return false;
> }
> $total_rows = mysql_num_rows($all_rs);
> mysql_free_result($all_rs);
> //mysql_close($link);
> $max_pages = ceil($total_rows/$rows_per_page);
> return $max_pages;
> }
>
>
> when i use this function it shows following warning
>
> Warning: mysql_query(): Your query requires a full tablescan (table
> Mobile_Tunes, 5 rows affected). Use EXPLAIN to optimize your query. in
> D:\Program Files\Apache
> Group\Apache2\htdocs\Breez\mtunes_main.php on line 47
>
>
>
> now can you tell me some solution
>
> bye
>
>
>
>
>
>
>
>
>
>
>
>
>
> John Mertic wrote:
> Can you provide the script you are running and the exact error message
> you are getting?
>
> John
>
> On 9/9/07, Asim wrote:
> > Hi
> >
> >
> > in my script when i scan whole table for result set to display in my page
> it shows warning that suggest me to use
> >
> >
> > EXPLAIN statement but i donot need it as i have to show records on page
> >
> > how to avoid this warning?
> >
> > Bye
> >
> >
> >
> >
> >
> >
> >
> >
> > Asim Jamil - 0092 345 4025907, Pakistan
> >
> > ---------------------------------
> > Be a better Globetrotter. Get better travel answers from someone who
> knows.
> > Yahoo! Answers - Check it out.
>
>
> --
> --
> John Mertic "Explaining a joke
> is like dissecting a frog: you
> jmertic@gmail.com understand it better,
> but the frog dies in the
> process."
>
> -Mark Twain
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> Asim Jamil - 0092 345 4025907, Pakistan
>
> ________________________________
> Be a better Heartthrob. Get better relationship answers from someone who
> knows.
> Yahoo! Answers - Check it out.
>
>


--
--
John Mertic "Explaining a joke
is like dissecting a frog: you
jmertic@gmail.com understand it better,
but the frog dies in the
process."

-Mark Twain

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Asim Jamil - 0092 345 4025907, Pakistan

---------------------------------
Need a vacation? Get great deals to amazing places on Yahoo! Travel.
--0-1448636462-1189432252=:54613--