[PHP-DB] Match Against Query with Integers

2004-07-26 Thread Harry G
Hi

Here's the senario...

Table 1- members
id - firstname - middlename - - country - region3

Fields country and region3 hold the integer codes for country and region3 is state

Table 2- country
id - countryname
Countryname is where the actual Country name is stored and id is the country code

Similarly Table 3 - region3
id - region3 where region3 is the state name and id is the region code.

I want to query country code and state code in the database but the fields are integer 
values. I am trying to modify the following query, but I think it will not work for 
integers? Is that correct?? 

$keywords are the contry  state codes (integers).

$query =  
   SELECT id, firstname, familyname, middlename, fathername, region3, region4, 
country,
  MATCH(country, region3, region4) AGAINST ('$keywords' IN BOOLEAN MODE) AS 
score  
  FROM members 
   WHERE MATCH(country, region3, region4) AGAINST ('$keywords' IN BOOLEAN MODE) 
ORDER BY score DESC; 

Thanks
Harry

[PHP-DB] match

2002-01-04 Thread louie miranda

Hi is it possible to match a certain string when a user submit's a form
I mean, ex: i put pre on a form field, and php will match it and example
deny it, oh well.. im new sorry.. :)

thank you

mysql_query (INSERT INTO members (ircname, email, realname, asl, info)
VALUES ('$ircname','$email','$realname','$asl','$info') );



# form.php ##
?php

mysql_connect ('my_db_host','my_user','my_pass');
mysql_select_db ('my_db');

mysql_query (INSERT INTO members (ircname, email, realname, asl, info)
VALUES ('$ircname','$email','$realname','$asl','$info') );

 print ($ircname);
 print ( );
 print (p);
 print (Thanks for joining!);

?
# form.php ##



# form.html #
html
body
form action=form.php method=GET
Ircname: input type=text name=ircname size=25 maxlength=25br
Email: input type=text name=email size=25 maxlength=25br
Realname: input type=text name=realname size=25 maxlength=25br
A/S/L: input type=text name=asl size=25 maxlength=25br
Info: input type=text name=info size=25 maxlength=25br
p
input type=submit
/form
/body
/html
# form.html #


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] match

2002-01-04 Thread Bogdan Stancescu

Why would this be a problem (i.e. the fact that a user may insert pre in a
form field)?

If you're worried about security (i.e. users adding JavaScript code) you can
always htmlspecialchars() the string...

Bogdan

louie miranda wrote:

 Hi is it possible to match a certain string when a user submit's a form
 I mean, ex: i put pre on a form field, and php will match it and example
 deny it, oh well.. im new sorry.. :)

 thank you

 mysql_query (INSERT INTO members (ircname, email, realname, asl, info)
 VALUES ('$ircname','$email','$realname','$asl','$info') );

 # form.php ##
 ?php

 mysql_connect ('my_db_host','my_user','my_pass');
 mysql_select_db ('my_db');

 mysql_query (INSERT INTO members (ircname, email, realname, asl, info)
 VALUES ('$ircname','$email','$realname','$asl','$info') );

  print ($ircname);
  print ( );
  print (p);
  print (Thanks for joining!);

 ?
 # form.php ##

 # form.html #
 html
 body
 form action=form.php method=GET
 Ircname: input type=text name=ircname size=25 maxlength=25br
 Email: input type=text name=email size=25 maxlength=25br
 Realname: input type=text name=realname size=25 maxlength=25br
 A/S/L: input type=text name=asl size=25 maxlength=25br
 Info: input type=text name=info size=25 maxlength=25br
 p
 input type=submit
 /form
 /body
 /html
 # form.html #

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] match

2002-01-04 Thread David Yee

If you're trying to prevent HTML tags from being submitted then try
htmlentities($your_variable).  That'll convert for example pre to
lt;pregt.

David

- Original Message -
From: louie miranda [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 04, 2002 6:22 PM
Subject: [PHP-DB] match


 Hi is it possible to match a certain string when a user submit's a form
 I mean, ex: i put pre on a form field, and php will match it and
example
 deny it, oh well.. im new sorry.. :)

 thank you

 mysql_query (INSERT INTO members (ircname, email, realname, asl, info)
 VALUES ('$ircname','$email','$realname','$asl','$info') );



 # form.php ##
 ?php

 mysql_connect ('my_db_host','my_user','my_pass');
 mysql_select_db ('my_db');

 mysql_query (INSERT INTO members (ircname, email, realname, asl, info)
 VALUES ('$ircname','$email','$realname','$asl','$info') );

  print ($ircname);
  print ( );
  print (p);
  print (Thanks for joining!);

 ?
 # form.php ##



 # form.html #
 html
 body
 form action=form.php method=GET
 Ircname: input type=text name=ircname size=25 maxlength=25br
 Email: input type=text name=email size=25 maxlength=25br
 Realname: input type=text name=realname size=25 maxlength=25br
 A/S/L: input type=text name=asl size=25 maxlength=25br
 Info: input type=text name=info size=25 maxlength=25br
 p
 input type=submit
 /form
 /body
 /html
 # form.html #


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Match () Against () with mysql php..

2001-07-23 Thread Koutsogiannopoulos Karolos

Hello again everyone...

I am doing some research for a project of mine and i was wondering if
someone is familliar with the match () against ()  function of mysql?
I know it returns a number etc 1.4343434 like a similarity number but how
can i convert this string to percentage like all the big search engines??

Regards.

___
PGP KEY ID: 0xA86600E9
___