[PHP-DB] PHP and Active Directory...

2003-11-12 Thread Boniforti Flavio
Hello all!

I managed to get data out of my Active Directory, but now I have a big 
trouble:
as I'm in Italy and use Italian, I also have characters like "à è ì ò 
ù", which are part of my users' names.

Now, when I get this data with PHP, I get following:

"à" gets "Ã"
"ò" gest "ò"
I didn't check the others, but I suppose they behave the same way.

Can anybody help me in solving this issue?

Thank you very much!

--
---
Boniforti Flavio
Provincia del Verbano-Cusio-Ossola
Ufficio Informatica
Tecnoparco del Lago Maggiore
Via dell'Industria, 25
28924 Verbania
---
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] RE: Adding in MySQL

2003-11-12 Thread Dillon, John
Thanks for the three replies and two tickings-off.  It was a spelling
mistake in my table name.

The reason I tend to top post is that you then don't have to read the
disclaimer or address details from my company in a reply.  Sometimes in easy
situations the question is clear from the reply plus the subject line.

Regards,

John


   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html

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



Re: [PHP-DB] RE: Adding in MySQL

2003-11-12 Thread David T-G
John --

...and then Dillon, John said...
% 
% Thanks for the three replies and two tickings-off.  It was a spelling
% mistake in my table name.

I hate those :-)  But I'm glad to see you found your answer.


% 
% The reason I tend to top post is that you then don't have to read the
% disclaimer or address details from my company in a reply.  Sometimes in easy

The proper answer isn't to bottom-post, either; that's just as bad.  The
proper answer is to trim away that which is not relevant as you reply in
context.  See this reply as a good example (though it has been argued that
leaving such as "Regards, John" is *still* excessive).

Remember, just because Outhouse ruined email/news netiquette and lawyers
insist on ridiculous disclaimers doesn't mean that you have to give in
and do it wrong.


% situations the question is clear from the reply plus the subject line.

Then trim away everything.


% 
% Regards,
% 
% John


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP-DB] PHP and Active Directory...

2003-11-12 Thread Boniforti Flavio
Russell Johnson wrote:

With luck, either the utf8_encode or utf8_decode functions might work, else the recode_string function (with some experimentation) should do it. 
Great! I'm using "utf8_decode"... and it works!!! Great...

... but I still hate Micro$oft's software! :-(

Thank you

--
---
Boniforti Flavio
Provincia del Verbano-Cusio-Ossola
Ufficio Informatica
Tecnoparco del Lago Maggiore
Via dell'Industria, 25
28924 Verbania
---
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: about some MySQL basics

2003-11-12 Thread pete M
I use phpmyadmin
http://www.phpmyadmin.net/home_page/

;-)
pete

Koala Yeung wrote:
> Maybe tis a little bit out of topic...
> 
> I want to learn using PHP with MySQL.
> After long time reading, I still have no idea how to build a database on a
> remote computer
> How to create a MySQL database on a remote server on the internet?

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



[PHP-DB] newbie question on data accumulation

2003-11-12 Thread Joffrey Leevy
Hi all:

Curious as to what happens after data is repeatedly
selected from a mysql table overtime.  Does it
accumulate as junk data, stored at some location and
eventually slow down the database/program/server? 
Does any purging have to take place?

Thanks
J

__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



Re: [PHP-DB] newbie question on data accumulation

2003-11-12 Thread CPT John W. Holmes
From: "Joffrey Leevy" <[EMAIL PROTECTED]>

> Curious as to what happens after data is repeatedly
> selected from a mysql table overtime.  Does it
> accumulate as junk data, stored at some location and
> eventually slow down the database/program/server?
> Does any purging have to take place?

I would imagine it would be thrown away when ever the connection was closed
or the result set was retrieved entirely. Why not ask this on a MySQL list?
You'd probably get much better answers.

---John Holmes...

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



Re: [PHP-DB] keyword searching

2003-11-12 Thread CPT John W. Holmes
From: "Adam Williams" <[EMAIL PROTECTED]>
> I am selecting a field in a database called description for keyword
> searching.  The field contains names of people, states, years, etc.  When
> someone searches for say "holmes north carolina" the query searches for
> exactly that, fields which have "holmes north carolina", and not fields
> that contaim holmes, north, and carolina.  So I run a str_replace to
> replace all spaces with *, which turns it into "holmes*north*carolina",
> but say that north carolina is before holmes in the field, it won't return
> those fields (it only returns fields in which holmes is infront of north
> carolina).  So how can I have it return all fields which contain all
> the words holmes, north, and carolina in any order, in that field?

Are you doing a fulltext search or just matching a word in a lookup column?

In the case of the latter, you'll have to split up the sentence into
individual words and look for each of them

WHERE column = 'holmes' || column = 'north' || column = 'carolina' ...

---John Holmes...
(not in North Carolina, btw!)

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



Re: [PHP-DB] keyword searching

2003-11-12 Thread Adam Williams
I'm doing a fulltext search.

CPT John W. Holmes wrote:

From: "Adam Williams" <[EMAIL PROTECTED]>

I am selecting a field in a database called description for keyword
searching.  The field contains names of people, states, years, etc.  When
someone searches for say "holmes north carolina" the query searches for
exactly that, fields which have "holmes north carolina", and not fields
that contaim holmes, north, and carolina.  So I run a str_replace to
replace all spaces with *, which turns it into "holmes*north*carolina",
but say that north carolina is before holmes in the field, it won't return
those fields (it only returns fields in which holmes is infront of north
carolina).  So how can I have it return all fields which contain all
the words holmes, north, and carolina in any order, in that field?


Are you doing a fulltext search or just matching a word in a lookup column?

In the case of the latter, you'll have to split up the sentence into
individual words and look for each of them
WHERE column = 'holmes' || column = 'north' || column = 'carolina' ...

---John Holmes...
(not in North Carolina, btw!)
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] keyword searching

2003-11-12 Thread CPT John W. Holmes
From: "Adam Williams" <[EMAIL PROTECTED]>
> CPT John W. Holmes wrote:
> > From: "Adam Williams" <[EMAIL PROTECTED]>
> >
> >>I am selecting a field in a database called description for keyword
> >>searching.  The field contains names of people, states, years, etc.
When
> >>someone searches for say "holmes north carolina" the query searches for
> >>exactly that, fields which have "holmes north carolina", and not fields
> >>that contaim holmes, north, and carolina.  So I run a str_replace to
> >>replace all spaces with *, which turns it into "holmes*north*carolina",
> >>but say that north carolina is before holmes in the field, it won't
return
> >>those fields (it only returns fields in which holmes is infront of north
> >>carolina).  So how can I have it return all fields which contain all
> >>the words holmes, north, and carolina in any order, in that field?
> >
> > Are you doing a fulltext search or just matching a word in a lookup
column?
>
> I'm doing a fulltext search.

What is your query? Assuming MySQL, I get a result like this:

mysql> select * from test where match(t) against ('holmes north carolina');
++
| t  |
++
| my name is john holmes from north carolina |
| i'm from the north |
| in carolina is my home |
| did I mention my last name is holmes?  |
++
4 rows in set (0.01 sec)

Isn't that what you want?

---John Holmes...

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



Re: [PHP-DB] keyword searching

2003-11-12 Thread Adam Williams
This is my SQL query:

"SELECT seriesno, governor, descr, boxno, year, eyear, docno
from rg2 WHERE seriesno = '$_POST[seriesno]' and governor matches 
'*$searchterm*' or descr matches '*$searchterm*'";

So as you can see, its gonna need some work to make it do fulltext 
searching of the descr field.  I'm not really sure how to make it do a 
keyword search, either since "holmes*north*carolina" doesn't work 
because it only searches  for those words in that order, if descr field 
in the database contains "north carolina holmes" it won't return that 
result, but I want it to because the person using the db is looking for 
all the fields that contain holmes, north, and carolina.

CPT John W. Holmes wrote:
From: "Adam Williams" <[EMAIL PROTECTED]>

CPT John W. Holmes wrote:

From: "Adam Williams" <[EMAIL PROTECTED]>

I am selecting a field in a database called description for keyword
searching.  The field contains names of people, states, years, etc.
When

someone searches for say "holmes north carolina" the query searches for
exactly that, fields which have "holmes north carolina", and not fields
that contaim holmes, north, and carolina.  So I run a str_replace to
replace all spaces with *, which turns it into "holmes*north*carolina",
but say that north carolina is before holmes in the field, it won't
return

those fields (it only returns fields in which holmes is infront of north
carolina).  So how can I have it return all fields which contain all
the words holmes, north, and carolina in any order, in that field?
Are you doing a fulltext search or just matching a word in a lookup
column?

I'm doing a fulltext search.


What is your query? Assuming MySQL, I get a result like this:

mysql> select * from test where match(t) against ('holmes north carolina');
++
| t  |
++
| my name is john holmes from north carolina |
| i'm from the north |
| in carolina is my home |
| did I mention my last name is holmes?  |
++
4 rows in set (0.01 sec)
Isn't that what you want?

---John Holmes...

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


[PHP-DB] Re: keyword searching

2003-11-12 Thread Chandra Kanth Chereddi
On 12/11/03 12:24 -0600, Adam Williams wrote:
 
> So as you can see, its gonna need some work to make it do fulltext 
> searching of the descr field.  I'm not really sure how to make it do a 
> keyword search, either since "holmes*north*carolina" doesn't work 
> because it only searches  for those words in that order, if descr field 
> in the database contains "north carolina holmes" it won't return that 
> result, but I want it to because the person using the db is looking for 
> all the fields that contain holmes, north, and carolina.

On MySQL may be a query like this should do the trick...

select * from match_test where mytext like "%north%" and mytext like
"%holmes%" and mytext like "%carolina%";

An intersection of the results of independent matches, or simply put an
"and" logic. This query would be pretty slow on large databases I
suppose.

HTH
-- 
CCK./   cck[at]ilug-hyd.org.in/[EMAIL PROTECTED] 

"Passion and gradualness"   -- Pavlov.

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



Re: [PHP-DB] keyword searching

2003-11-12 Thread CPT John W. Holmes
From: "Adam Williams" <[EMAIL PROTECTED]>

> This is my SQL query:
>
> "SELECT seriesno, governor, descr, boxno, year, eyear, docno
> from rg2 WHERE seriesno = '$_POST[seriesno]' and governor matches
> '*$searchterm*' or descr matches '*$searchterm*'";

Looks like you're doing the equivilent to a MySQL "LIKE" search, i.e.
looking for a pattern in a string instead of doing a FULLTEXT search.

Consult you're documentation, as I don't think the PHP list can be much more
help.

---John Holmes...

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



[PHP-DB] Changing case

2003-11-12 Thread Robert Sossomon
I have a form that allows for an item to be entered, the other pieces
have been fixed so far that were bogging me down, but now I am looking
for a way to convert any entry in the form to be UPPER case so that when
the quote is listed, they are alphabetical.  

The problem is if someone enters aa-1234 and the other items in the
quote are FF-2345 and QQ-3456 then the aa-1234 is UNDER them, instead of
on top.

/
//
//   Store.php
//
/
/*
  The following code allows for the addition of a non-stock item.  All
information is added automatically to the quoter for the salesman.
*/

$display_block .= "Input a new item: Item ID:Description:Quantity: ";
$display_block .= "01";
for ($i=2; $i < 301; $i++){
 $display_block .= "$i";
}
$display_block .= "Price:";


/
//
//  addspec.php
//
/
if ($_POST[sel_item_qty] != "0")
{
 if($_POST[sel_item_id] != "")
 {   
   //add info to cart table
   $addtocart = "insert into store_shoppertrack
values('','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]',
'$_POST[sel_item_price]','$_POST[sel_item_desc]', now())";
  
   mysql_query($addtocart);
  
   //redirect to showcart page
   header("Location:$_POST[url]");
   exit;
 } else {
  //send them somewhere else
  header("Location:ohcrud.php");
  exit;
 }
} else {
  //print message
  $display_block .= "You must select a Quantity. Please continue to shop!";
 } 


TIA!!

Robert

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



[PHP-DB] RE: [PHP] Changing case

2003-11-12 Thread Jay Blanchard
[snip]
The problem is if someone enters aa-1234 and the other items in the
quote are FF-2345 and QQ-3456 then the aa-1234 is UNDER them, instead of
on top.
[/snip]

http://www.php.net/strtoupper

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



[PHP-DB] Re: [PHP] Changing case

2003-11-12 Thread CPT John W. Holmes
From: "Robert Sossomon" <[EMAIL PROTECTED]>

> I have a form that allows for an item to be entered, the other pieces
> have been fixed so far that were bogging me down, but now I am looking
> for a way to convert any entry in the form to be UPPER case so that when
> the quote is listed, they are alphabetical.  

http://us2.php.net/strtoupper

---John Holmes...

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



[PHP-DB] keyword searching

2003-11-12 Thread Adam Williams
Hello,

I am selecting a field in a database called description for keyword 
searching.  The field contains names of people, states, years, etc.  When 
someone searches for say "holmes north carolina" the query searches for 
exactly that, fields which have "holmes north carolina", and not fields 
that contaim holmes, north, and carolina.  So I run a str_replace to 
replace all spaces with *, which turns it into "holmes*north*carolina", 
but say that north carolina is before holmes in the field, it won't return 
those fields (it only returns fields in which holmes is infront of north 
carolina).  So how can I have it return all fields which contain all 
the words holmes, north, and carolina in any order, in that field?

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



[PHP-DB] RE: [PHP] keyword searching

2003-11-12 Thread Jay Blanchard
[snip]
I am selecting a field in a database called description for keyword 
searching.  The field contains names of people, states, years, etc.
When 
someone searches for say "holmes north carolina" the query searches for 
exactly that, fields which have "holmes north carolina", and not fields 
that contaim holmes, north, and carolina.  So I run a str_replace to 
replace all spaces with *, which turns it into "holmes*north*carolina", 
but say that north carolina is before holmes in the field, it won't
return 
those fields (it only returns fields in which holmes is infront of north

carolina).  So how can I have it return all fields which contain all 
the words holmes, north, and carolina in any order, in that field?
[/snip]

You don't say which database you are using, but several allow for full
text searching of fields where the order is inconsequential. The
behaviour you describe is preceisely how most (if not all) databases
will return a search on a "standard" column type.

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



[PHP-DB] Re: [PHP] keyword searching

2003-11-12 Thread Adam Williams
I'm using Informix SQL.  Do you know how to do full text searching on 
Informix?  If so, please share the details :)

Jay Blanchard wrote:

[snip]
I am selecting a field in a database called description for keyword 
searching.  The field contains names of people, states, years, etc.
When 
someone searches for say "holmes north carolina" the query searches for 
exactly that, fields which have "holmes north carolina", and not fields 
that contaim holmes, north, and carolina.  So I run a str_replace to 
replace all spaces with *, which turns it into "holmes*north*carolina", 
but say that north carolina is before holmes in the field, it won't
return 
those fields (it only returns fields in which holmes is infront of north

carolina).  So how can I have it return all fields which contain all 
the words holmes, north, and carolina in any order, in that field?
[/snip]

You don't say which database you are using, but several allow for full
text searching of fields where the order is inconsequential. The
behaviour you describe is preceisely how most (if not all) databases
will return a search on a "standard" column type.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] keyword searching

2003-11-12 Thread Robert Sossomon
Explode the kewords list.  I have mine explode the keyword and search
the description field.  It CAN limit it by category AND/OR by Vendor.
But this will do the trick without the limiters.

$keyword = $_POST[keyword];
$keywords = explode(" ", $keyword);
// so you can search for each word they enter
if ($category == "") {
$category = '%';
}

if ($vendor == "") {
$vendor = '%';
}
$query = "select * from DATABASE where vendor like '$vendor' AND
cat_code like '$category'";
// set up the part of the query that will always be the same
if (!$keywords) {
$keywords = '%';
//in case they don't enter any text
} else {
for ($i = 0; $i < count($keywords); $i++) {
$query .= " AND description like '%$keywords[$i]%'";
//modify the query to search for each word they enter
}
}
$query .= " order by item_num asc";
// to sort alphabetically
$result = mysql_query($query);

/* Determine the number of records returned */
while ($row = MYSQL_FETCH_ROW($result))
$number = mysql_numrows($result);

if (!$number)
{
print("There are no results that match your query");
}
else
{
/* Print the relevant information */
$i = 0;
 
print  "";

while ($i < $number)
{
$item_id = mysql_result($result, $i,"id");
$item_name = mysql_result($result, $i,"item_num");
$item_desc = mysql_result($result, $i,"description");

if ($i%2 == 0)
{
print "What do you want done with the data\n";
}
else
{
print "What do you want done with the data\n";
}
$i++;
}
print "";
}

/* Close the database connection */
MYSQL_CLOSE();
?>




~~~
Love and you will be loved, and you will be able to do all that you
could not do unloved.

-Marques de Santillana. 
~~~

-Original Message-
From: Adam Williams [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 12, 2003 12:50 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP-DB] keyword searching


Hello,

I am selecting a field in a database called description for keyword 
searching.  The field contains names of people, states, years, etc.
When 
someone searches for say "holmes north carolina" the query searches for 
exactly that, fields which have "holmes north carolina", and not fields 
that contaim holmes, north, and carolina.  So I run a str_replace to 
replace all spaces with *, which turns it into "holmes*north*carolina", 
but say that north carolina is before holmes in the field, it won't
return 
those fields (it only returns fields in which holmes is infront of north

carolina).  So how can I have it return all fields which contain all 
the words holmes, north, and carolina in any order, in that field?

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

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



[PHP-DB] Re: [PHP] keyword searching

2003-11-12 Thread CPT John W. Holmes
From: "Adam Williams" <[EMAIL PROTECTED]>

> I'm using Informix SQL.

Could have saved some bandwidth by mentioning that in the first place and
only posting to either php-general or php-db (which is more appropriate),
not both. :)

Ignore what my other posts said, as I don't know how Informix works.

---John Holmes...

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



[PHP-DB] RE: [PHP]{Semi-OT} keyword searching

2003-11-12 Thread Jay Blanchard
[snip]
I'm using Informix SQL.  Do you know how to do full text searching on 
Informix?  If so, please share the details :)
[/snip]

You will have to consult your Informix documentation in order to discern
if full-text features are available. Usually the text column where the
information is being held has to be set to the 'full-text' type.

You could fake this with PHP by taking your search terms and shuffling
them, but this requires performing the query several times with shuffled
requests.

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