[PHP-DB] showing warnings

2007-09-10 Thread Asim

Hi
   
   
  this result is shown by mysql on running command prompt
   
  
mysql> explain SELECT Tune_Name,Tune_Type FROM Mobile_Tunes;
+--+--+---+--+-+--+--+---+
| table| type | possible_keys | key  | key_len | ref  | rows |
 Extra |
+--+--+---+--+-+--+--+---+
| Mobile_Tunes | ALL  | NULL  | NULL |NULL | NULL |4 |
   |
+--+--+---+--+-+--+--+---+
1 row in set (0.00 sec)
  mysql>
   
   
  and
   
   
  
mysql> SELECT Tune_Name,Tune_Type FROM Mobile_Tunes;
+---+---+
| Tune_Name | Tune_Type |
+---+---+
| pakistani | midi  |
| pakistan2 | midi  |
| usa   | midi  |
| uk| midi  |
+---+---+
4 rows in set (0.00 sec)
  mysql>
   
   
  now what next?
   
   
   
  bye
   
   
   
   


John Mertic <[EMAIL PROTECTED]> wrote:  Run the query through MySQL directly 
prepending EXPLAIN to the query
and attach the results here.

John

On 9/10/07, Asim wrote:
> 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
> > [EMAIL PROTECTED] 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
> [EMAIL PROTECTED] 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
>
> 
> Looking for a deal? Find great prices on flights and hotels with Yahoo!
> FareChase.
>
>


-- 
-- 
John Mertic "Explaining a joke
is like dissecting a frog: you
[EMAIL PROTECTED] understand it better,
but the frog dies in the
process."

-Mark Twain

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




Asim Jamil  - 0092 345 4025907, Pakistan
   
-
Tonight's top picks. What will you watch tonight? Preview the hottest shows on 
Yahoo! TV.

Re: [PHP-DB] ? "SELECT TABLE" Command

2007-09-10 Thread Mike W.
Chris wrote (in news:[EMAIL PROTECTED]):

> > It is an SQL query (probably MySQL, but perhaps SQLite or possibly even
PGSQL or mSQL):
>
> The line after $query should tell you what uses it ;)

Sorry, I meant the book may have been about any of those; I was skimming through
a bunch of SQL books at that time and don’t know which one I got it from.

> > $query="SELECT TABLE $tablename;";
> > if (mysql_query($query, $link)) {
> >  echo($indent."The table, '$tablename', was successfully opened.\n"); }
> >
> > To make things even stranger, it works fine in the original program that I
> > put it in (although what, if anything, it does is beyond me), but fails
> > when I try it in another program (yes, I took care of $tablename).
>
> What's the exact query that's run? Maybe $tablename contains more than just a
table name.

Nope, it’s just

SELECT TABLE lyrics;

> Different mysql version? Maybe it was in an older version of mysql but they
removed it.
>
> It doesn't work in mysql5 or mysql4.0, maybe it does in an older version
though.
>
> Looks like you're trying to check that the mysql user you connected as has
access to that table.

It really feels like a command I may have used in the SQLite analyzer or
something.  However, I’m sure I copied it from an example script in a book.  I’
ve put holds on all the books on PHP and (My)SQL at the library and will check
them all.

-- 
Mike W.

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



Re: [PHP-DB] mssql_connect not working from command line

2007-09-10 Thread Chris


However, a web page that includes the same file with the mssql_connect 
call still works fine, and now it makes sense that I see mssql is still 
enabled in phpinfo.


The apache version of the php.ini file is different to the cli version. 
Make sure you are looking at the right one.


On debian I have two separate directories for each config - 
/etc/php5/apache2/ and /etc/php5/cli/


Try this:

php -i  | grep 'php.ini'

from the command line to work out which php.ini to look at.

--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] ? "SELECT TABLE" Command

2007-09-10 Thread Chris


Please fix your reply-to address.


It
is an SQL query (probably MySQL, but perhaps SQLite or possibly even PGSQL or
mSQL):


The line after $query should tell you what uses it ;)


$query="SELECT TABLE $tablename;";
if (mysql_query($query, $link)) {
 echo($indent."The table, '$tablename', was successfully opened.\n");
}

To make things even stranger, it works fine in the original program that I put
it in (although what, if anything, it does is beyond me), but fails when I try
it in another program (yes, I took care of $tablename).


What's the exact query that's run? Maybe $tablename contains more than 
just a table name.


Different mysql version? Maybe it was in an older version of mysql but 
they removed it.


It doesn't work in mysql5 or mysql4.0, maybe it does in an older version 
though.



Looks like you're trying to check that the mysql user you connected as 
has access to that table.


--
Postgresql & php tutorials
http://www.designmagick.com/

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



[PHP-DB] mssql_connect not working from command line

2007-09-10 Thread Instruct ICC
I had cronjobs running fine on Linux which included a file which called 
mssql_connect.


Today when I run the cronjob script directly from the command line, I get:
PHP Fatal error:  Call to undefined function mssql_connect() in 
/the/included/file.php on line #


Fatal error: Call to undefined function mssql_connect() in 
/the/included/file.php on line #


I also notice that the cronjob started failing 1 month ago.

The file is owned by the command line user and apache is in its group and 
vice versa.


However, a web page that includes the same file with the mssql_connect call 
still works fine, and now it makes sense that I see mssql is still enabled 
in phpinfo.


The admin says nothing changed.

Is there a setting that must have been changed to disallow this function 
from working on the command line?


I'm using PHP Version 5.1.6 and /etc/php.ini has changed 2 months ago and 
the cronjob worked since then.


_
Gear up for Halo® 3 with free downloads and an exclusive offer. 
http://gethalo3gear.com?ocid=SeptemberWLHalo3_MSNHMTxt_1


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



[PHP-DB] ? "SELECT TABLE" Command

2007-09-10 Thread Alec S.
Hi,

I've got a PHP program I wrote a year or so ago with the oddest line of code.  I
know I didn't come up with it myself; I must have adapted it from a book or
something, but I have checked all the books it could have come from and could
not find it in any of them, nor can I find any such command anywhere else.  It
is an SQL query (probably MySQL, but perhaps SQLite or possibly even PGSQL or
mSQL):

$query="SELECT TABLE $tablename;";
if (mysql_query($query, $link)) {
 echo($indent."The table, '$tablename', was successfully opened.\n");
}

To make things even stranger, it works fine in the original program that I put
it in (although what, if anything, it does is beyond me), but fails when I try
it in another program (yes, I took care of $tablename).


Does anyone have any idea where this bizarre piece of code came from, what it
does, if it's valid, or why it works even though such a command does not even
seem to exist?  This is has had me baffled for several months now.


Thanks.

-- 
Mike W.

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



Re: [PHP-DB] showing warnings

2007-09-10 Thread John Mertic
Run the query through MySQL directly prepending EXPLAIN to the query
and attach the results here.

John

On 9/10/07, Asim <[EMAIL PROTECTED]> wrote:
> Hi
>
> i have added index on both columns but still same warning is issued by mysql
>
> then what i do now
>
> John Mertic <[EMAIL PROTECTED]> 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
> > [EMAIL PROTECTED] 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
> [EMAIL PROTECTED] 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
>
>  
> Looking for a deal? Find great prices on flights and hotels with Yahoo!
> FareChase.
>
>


-- 
-- 
John Mertic"Explaining a joke
is like dissecting a frog: you
[EMAIL PROTECTED]  understand it better,
but the frog dies in the
  process."

  -Mark Twain

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



Re: [PHP-DB] showing warnings

2007-09-10 Thread Asim
Hi
   
  i have added index on both columns but still same warning is issued by mysql 
   
  then what i do now?
   
  BYE
   
   
   
   
   
  

John Mertic <[EMAIL PROTECTED]> 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
> [EMAIL PROTECTED] 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
[EMAIL PROTECTED] 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
   
-
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos & more. 

Re: [PHP-DB] showing warnings

2007-09-10 Thread Asim
Hi
   
  i have added index on both columns but still same warning is issued by mysql 
   
  then what i do now

John Mertic <[EMAIL PROTECTED]> 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
> [EMAIL PROTECTED] 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
[EMAIL PROTECTED] 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
   
-
Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.

Re: [PHP-DB] pdo_mysql segfault error

2007-09-10 Thread Goltsios Theodore
   Well this is not the proper list for these kind of questions but 
since you posted know that you should include the apache compile time 
options. Well I think that you should recompile apache, because mysql 
support is probably compiled in and since you upgraded mysql you should 
compile apache to use the new one. In order to figure out your compile 
time options you could use:


httpd -V

and httpd -l is useful too if you want to know the compiled in modules.


Thodoris.

Slith wrote:
i'm trying to enable pdo_mysql extension, however i keep getting the 
following segfault error when i restart apache:


httpd[20567]: segfault at 0020abef8f07 rip 0020abef8f07 rsp 
006e6ad0 error 14


my setup is the following:

Apache 1.3.37
php 5.2.2
mysql 5.0.41

not sure wether this problem is cause by my newer mysql version or 
64bit server. has any gotten PDO_MYSQL on 64bit server?




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



Re: [PHP-DB] Dates - Best Approach

2007-09-10 Thread Goltsios Theodore


   If you are using unix-like OSes then you could write a program or  a 
script using (PHP, perl, bash, csh even C) whatever it suits you and use 
cron daemon to run it every month. This script should query the database 
and find out if is needed to be sent. The alternative (not the suggested 
solution for this specific task) is to write a daemon process and 
configure it to run using an interval like every 15 days or a week or 
whatever you need.


   In case you use windowz (not helping yourself very much) then 
perhaps the task scheduler could be of use to help you do something 
similar. I have very little experience of that kind of masochism so I 
'll let someone else to do this dirty work :-) .



Malcolm Clark wrote:

Hi!

I am designing a contact management system, so that entries (client 
records) can be flagged, so that an email is sent out after 'n' 
months, to remind the user to contact this particular client.


So, there would simply be a drop down menu with options: None, 1 
month, 2 month, ... 12 months etc


I also imagine that when the client record is viewed, it states how 
long is left until the client is to be contacted. eg "36 days" or 
"approx 3 weeks"


My question? Are there any classes or packages that might help me with 
this task. Maybe somebody has got some other ideas?



Kind Regards,

Malcolm Clark



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