[PHP-DB] How to: Include identifier with a query

2009-11-02 Thread listread

Greetings!

We are searching for names that might or might not exist in a 4 million 
row db and have to do a lot of fuzzy searches that often don't return 
results.


I would like the use to have the option of killing a query process.  
Since we are apt to have several queries running KILL QUERY doesn't seem 
to work.  I would like to use KILL (process id) instead.  We can use 
SHOW FULL PROCESSLIST to get a complete list of the processes, but we 
need for the code to identify which one to kill.


Here's the question:  How can I flag a particular query so it can be 
identified from the array SHOW FULL PROCESSLIST generates?


Thanks!

- Ron


Re: [PHP-DB] How to: Include identifier with a query

2009-11-02 Thread TG
I looked into this years ago for something I was doing, but don't remember 
looking for a solution in MySQL.

Just wanted to share that.. um.. I think it was with MS SQL Server.. there 
was a way to put a tag in your DSN connection string that would show up 
on the process list.  I don't know if that helps, but just to add to the 
list of how *some* people do it.

Good luck!

-TG

- Original Message -
From: listread listr...@cze.com
To: php-db@lists.php.net
Date: Mon, 02 Nov 2009 07:16:23 -0600
Subject: [PHP-DB] How to: Include identifier with a query

 Greetings!
 
 We are searching for names that might or might not exist in a 4 million 
 row db and have to do a lot of fuzzy searches that often don't return 
 results.
 
 I would like the use to have the option of killing a query process.  
 Since we are apt to have several queries running KILL QUERY doesn't seem 
 to work.  I would like to use KILL (process id) instead.  We can use 
 SHOW FULL PROCESSLIST to get a complete list of the processes, but we 
 need for the code to identify which one to kill.
 
 Here's the question:  How can I flag a particular query so it can be 
 identified from the array SHOW FULL PROCESSLIST generates?
 
 Thanks!
 
 - Ron
 
 

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



Re: [PHP-DB] How to: Include identifier with a query

2009-11-02 Thread Chris

listread wrote:

Greetings!

We are searching for names that might or might not exist in a 4 million 
row db and have to do a lot of fuzzy searches that often don't return 
results.


I would like the use to have the option of killing a query process.  
Since we are apt to have several queries running KILL QUERY doesn't seem 
to work.  I would like to use KILL (process id) instead.  We can use 
SHOW FULL PROCESSLIST to get a complete list of the processes, but we 
need for the code to identify which one to kill.


KILL id works on the process id.

mysql show processlist;
++--+---+--+-+--+---+--+
| Id | User | Host  | db   | Command | Time | State | Info |
++--+---+--+-+--+---+--+
| 40 | root | localhost | NULL | Query   |0 | NULL  | show 
processlist |

++--+---+--+-+--+---+--+
1 row in set (0.00 sec)


The first column *is* the process id.

Here's the question:  How can I flag a particular query so it can be 
identified from the array SHOW FULL PROCESSLIST generates?


You can put comments in your sql:

mysql /** generated by x */ select now();
+-+
| now()   |
+-+
| 2009-11-03 08:45:49 |
+-+
1 row in set (0.00 sec)

--
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] Does PHP5 support querying an MS Access MDE file?

2009-11-02 Thread Timothy Legg
Hello,

I have PHP Version 5.2.6-1+lenny3

I have been having difficulty using odbc_connect with an MS Access MDE
database.  I do have php5-mysql and php5-odbc installed on this server.

Due to the rather poor search results regarding the topic of querying MDE
files with PHP, I am becoming increasingly concerned that this file type
is not supported.

Is it possible to query an MDE file via PHP5 or should I try different
approach to querying the database from our linux server?  I am interested
in your thoughts.

Thanks for your help.

Tim Legg


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



[PHP-DB] PHP Update query

2009-11-02 Thread Ron Piggott
How do I test if an UPDATE query worked

$query = UPDATE `clients` SET `company` = '$company', `contact` =
'$contact', `phone` = '$phone', `city` = '$city' WHERE
`clients`.`reference` =$client LIMIT 1;
$client_result=mysql_query($query);

???

Ron


Re: [PHP-DB] PHP Update query

2009-11-02 Thread Chris

Ron Piggott wrote:

How do I test if an UPDATE query worked

$query = UPDATE `clients` SET `company` = '$company', `contact` =
'$contact', `phone` = '$phone', `city` = '$city' WHERE
`clients`.`reference` =$client LIMIT 1;
$client_result=mysql_query($query);

???


http://www.php.net/manual/en/function.mysql-affected-rows.php

If it returns 0 that could mean:
- no row was originally found with that condition
or
- no update was performed (the data stayed the same)

--
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] PHP Update query

2009-11-02 Thread Yves Sucaet

Hi Ron,

Have a look at http://www.php.net/manual/en/function.mysql-info.php

- Original Message - 
From: Ron Piggott ron@actsministries.org

To: PHP DB php-db@lists.php.net
Sent: Monday, November 02, 2009 11:59 PM
Subject: [PHP-DB] PHP Update query



How do I test if an UPDATE query worked

$query = UPDATE `clients` SET `company` = '$company', `contact` =
'$contact', `phone` = '$phone', `city` = '$city' WHERE
`clients`.`reference` =$client LIMIT 1;
$client_result=mysql_query($query);

???

Ron




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



Re: [PHP-DB] PHP Update query

2009-11-02 Thread Sudheer Satyanarayana

On Tuesday 03 November 2009 11:29 AM, Ron Piggott wrote:

How do I test if an UPDATE query worked

$query = UPDATE `clients` SET `company` = '$company', `contact` =
'$contact', `phone` = '$phone', `city` = '$city' WHERE
`clients`.`reference` =$client LIMIT 1;
$client_result=mysql_query($query);

???

Ron

   

From the manual page:

For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, 
*mysql_query()* returns *TRUE* on success or *FALSE* on error. 


If $client_result == true you know the query was successful.


--

With warm regards,
Sudheer. S
Tech stuff: http://techchorus.net
Business: http://binaryvibes.co.in


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