Re: Full-text searching with quoted bind variables

2006-11-28 Thread Visolve DB Team

Hi,

The thing is, if the Outermost quote is single( ' ) ,  and if you try to use 
the same inside the string, in that case you need to go for \'.  The same 
applies for Double quotes also.  Double quotes within the single or single 
quote within the double dosen't reqire blackslash.


For instance,
mysql>  select * from articles where match(title,body) against (' 
\'database\' ');

or can be like this
mysql> select * from articles where match(title,body) against (' "database" 
');


Thanks
ViSolve DB Team.

- Original Message - 
From: "William Langshaw" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, November 29, 2006 12:54 AM
Subject: Full-text searching with quoted bind variables



I am using Full-Text searching with In Boolean Mode. I am generating
my query by using binding parameters. If a user types in a quoted
string on the search form (in order to match that string as-is), the
binding mechanism escape it with a backslash. The query runs fine and
it appears to return the same results when I run the same query  by
hand without the backslashes. I just want to make sure these
backslashes are not being interpreted differently and that the
full-text search engine is treating the double-quotes as they are
intended (and not looking for them literally)

E.g.

... AND MATCH (title, description) AGAINST ('chev* \"malibu\"' IN BOOLEAN 
MODE)


vs

... AND MATCH (title, description) AGAINST ('chev* "malibu"' IN BOOLEAN 
MODE)



They both seem to be Ok, but I just want to make sure now, before
wierd problems come up later...

thanks
-william

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Full-text searching with quoted bind variables

2006-11-28 Thread William Langshaw

I am using Full-Text searching with In Boolean Mode. I am generating
my query by using binding parameters. If a user types in a quoted
string on the search form (in order to match that string as-is), the
binding mechanism escape it with a backslash. The query runs fine and
it appears to return the same results when I run the same query  by
hand without the backslashes. I just want to make sure these
backslashes are not being interpreted differently and that the
full-text search engine is treating the double-quotes as they are
intended (and not looking for them literally)

E.g.

... AND MATCH (title, description) AGAINST ('chev* \"malibu\"' IN BOOLEAN MODE)

vs

... AND MATCH (title, description) AGAINST ('chev* "malibu"' IN BOOLEAN MODE)


They both seem to be Ok, but I just want to make sure now, before
wierd problems come up later...

thanks
-william

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Cannot lock: called with 1 bind variables when 0 are needed

2004-10-24 Thread Jonathan Mangin
Another interesting thing. Mysql is running on Solaris.
Once past the "Cannot lock" error, I got approximately:
db.TBUSR does not exist on this server
db.tbusr does. I thought table names were case insensitive
on unix. Apparently not.
- Original Message - 
From: "Mike Wexler" <[EMAIL PROTECTED]>
To: "Jonathan Mangin" <[EMAIL PROTECTED]>
Sent: Sunday, October 24, 2004 4:53 PM
Subject: Re: Cannot lock: called with 1 bind variables when 0 are needed


Try this:
my $sql = "LOCK tables TBUSR write, TBAUTH write, TBDATALOG write,
TBAGCY write, TBREL write, TBACCESSLOG write";
my $sth = $dbh->prepare($sql);
$sth->execute();
On Sat, 23 Oct 2004 20:39:38 -0500, Jonathan Mangin
<[EMAIL PROTECTED]> wrote:
Hi all,
With 3.23.38 I have:
my $sql = "LOCK tables TBUSR write, TBAUTH write, TBDATALOG write,
TBAGCY write, TBREL write, TBACCESSLOG write";
my $sth = $dbh->prepare($sql);
$sth->execute($sql) || die "Cannot lock: " . $sth->errstr();
I get:
Cannot lock: called with 1 bind variables when 0 are needed ... 
Carp.pm...

--Jon
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Cannot lock: called with 1 bind variables when 0 are needed

2004-10-24 Thread Jonathan Mangin
Hmmm, you're probably right.  I got carried away.
- Original Message - 
From: "Mike Wexler" <[EMAIL PROTECTED]>
To: "Jonathan Mangin" <[EMAIL PROTECTED]>
Sent: Sunday, October 24, 2004 4:53 PM
Subject: Re: Cannot lock: called with 1 bind variables when 0 are needed


Try this:
my $sql = "LOCK tables TBUSR write, TBAUTH write, TBDATALOG write,
TBAGCY write, TBREL write, TBACCESSLOG write";
my $sth = $dbh->prepare($sql);
$sth->execute();
On Sat, 23 Oct 2004 20:39:38 -0500, Jonathan Mangin
<[EMAIL PROTECTED]> wrote:
Hi all,
With 3.23.38 I have:
my $sql = "LOCK tables TBUSR write, TBAUTH write, TBDATALOG write,
TBAGCY write, TBREL write, TBACCESSLOG write";
my $sth = $dbh->prepare($sql);
$sth->execute($sql) || die "Cannot lock: " . $sth->errstr();
I get:
Cannot lock: called with 1 bind variables when 0 are needed ... 
Carp.pm...

--Jon
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Cannot lock: called with 1 bind variables when 0 are needed

2004-10-23 Thread Jonathan Mangin
Hi all,
With 3.23.38 I have:
my $sql = "LOCK tables TBUSR write, TBAUTH write, TBDATALOG write,
TBAGCY write, TBREL write, TBACCESSLOG write";
my $sth = $dbh->prepare($sql);
$sth->execute($sql) || die "Cannot lock: " . $sth->errstr();
I get:
Cannot lock: called with 1 bind variables when 0 are needed ... Carp.pm...
--Jon
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Bind Variables.]

2003-01-24 Thread Gelu Gogancea
Hi,
With MySQL you can use variables which are represented using "@" character.
You can not use this variable like in Oracle or DB2 because ,for the moment,
MySQL didn't have necessary "tools" which can handle like "bind", this
variables.
I guess you can make some "improvisations" to suit at your needs.

For example :
If you wish to store an entire row(...or selective items from one row) in
the
one variable and after this to insert in other table:
@a:=''; /* initialise the variable a*/
select @a:=CONCAT(FIRST_ITEM,',',SECOND_ITEM,',',THIRD_ITEM...etc) from
YOUR_TABLES where SOME_CONDITIONS.
insert into other_table
values(MID(@,POSITION_OF1-st_ITEM,LENGTH),MID(@,POSITION_2-nd,LENGTH)etc
)
Also, this can be replaced very well,if you use INSERT...SELECT statement.

Another example which can help you to avoid bind array variable and also to
avoid FOREACH() function is:
insert into YOUR_TABLES SET
YOUR_1-st_FIELD=1-st_ITEM,YOUR_2-nd_FIELD=2-nd_ITEM...etc select
IF(1-st_ITEM SOME_FILTERING_CONDITIONS,RETURN_IF_TRUE,RETURN_IF_FALSE)...etc
from OTHER_TABLE where CONSTRAINT_CONDITION...

I hope it help,

Regards,

Gelu
_
G.NET SOFTWARE COMPANY

Permanent e-mail address : [EMAIL PROTECTED]
  [EMAIL PROTECTED]
- Original Message -
From: "Alvaro Avello" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 24, 2003 1:54 PM
Subject: [Fwd: Bind Variables.]


>   Hi everybody:
>
>  I 'm actually having an problem trying to mygrate to mysql. it's true
> that mysql does not support bind variables ? . Actually the development
> in my company is over Centura team developer connected to Centura
> Sqlbase , and the code of the aplications is widely using bind variables
> . there is a workaround for this ? there is a posibility that in the
> future releases of mysql bind variables will be supported ?' thanks in
> advance.
>
> Alvaro.
>
>
>
>
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




[Fwd: Bind Variables.]

2003-01-24 Thread Alvaro Avello
 Hi everybody:

I 'm actually having an problem trying to mygrate to mysql. it's true 
that mysql does not support bind variables ? . Actually the development 
in my company is over Centura team developer connected to Centura 
Sqlbase , and the code of the aplications is widely using bind variables 
. there is a workaround for this ? there is a posibility that in the 
future releases of mysql bind variables will be supported ?' thanks in 
advance.

Alvaro.




-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Bind Variables.

2003-01-23 Thread Alvaro Avello
Hi everybody:
I 'm actually having an problem trying to mygrate to mysql. it's true 
that mysql does not support bind variables ? . Actually the development 
in my company is over Centura team developer connected to Centura 
Sqlbase , and the code of the aplications is widely using bind variables 
. there is a workaround for this ? there is a posibility that in the 
future releases of mysql bind variables will be supported ?' thanks in 
advance.

Alvaro.


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



mysql bind variables in php

2001-12-27 Thread Henrik

Does anyone know if it’s possible to use any kind of bind variables to make the 
queries run faster. In perl I use;

 
$sth=$dbh->prepare(”select * from table where name = ?”);
$sth->execute(”Henrik”);
 

Can I do it in PHP?
 
Thanks / Henrik


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php