RE: [PHP-DB] I have a " in my db ?

2002-03-06 Thread Beau Lebens

try using 

echo htmlspecialchars($name);

that wya the " will convert to a " and should display properly in the
HTML

(check your source before doing this, it is probably all there, but the " is
causing HTML rendering problems or something)

HTH

Beau

// -Original Message-
// From: Dave carrera [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 7 March 2002 1:38 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] I have a " in my db ?
// 
// 
// Hi All
// 
//  
// 
// I think this has something to do with either
// 
//  
// 
// Stripslashes or Addslashes but which one. And where do I use it.
// 
//  
// 
// I have a product that has a " in the name and I have created 
// a drop down
// list from the names.
// 
//  
// 
// I cant get it to reg the name. all it reg is 15" instead of 
// th full name
// which is 15" lcd Monitor.
// 
//  
// 
// How do I get past this issue
// 
//  
// 
// The php manual has no usage examples relevant to my needs.
// 
//  
// 
// Please help
// 
//  
// 
// Dave c
// 
// 

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




[PHP-DB] Re: php-db Digest 6 Mar 2002 16:43:13 -0000 Issue 1086

2002-03-06 Thread Robin L. Small

RE the Dynamic Dropdown..

the javascript I've done, and I've also played with a page that 
resubmits to itself if certain default dropdowns aren't populated and 
have a target page if they are populated..

so.. if car_mfg is undefined then submit_target=$PHP_SELF or if car_mfg 
is defined (and all you're expecting is car_model after that) then 
submit_target=new page

since it's a server side scripting, I don't see any way it can know 
what the client's doing.. so the best way (imo) is to either automate 
it with some client-side scripting, or limit their options and base 
their page off of what they submit..

dunno if that helps or makes sense..

~ Rob
Fresno, CA



php-db Digest 6 Mar 2002 16:43:13 - Issue 1086

Topics (messages 17498 through 17514):

Re: Dynamic Drop Down Box
17498 by: Ralph Friedman
17508 by: Aron Pilhofer
17510 by: Edward Marczak
17511 by: Leotta, Natalie (NCI/IMS)
17513 by: Paul Burney

MySQL_connect
17499 by: Mikael_Jensen.Dell.com
17501 by: Jason Wong
17512 by: Josh Trutwin

how to make multiple in a coloum in mysql DB
17500 by: Yoga Anak Medan
17502 by: Markus Lervik
17503 by: DL Neil

Re: [PHP] timestamp iin MySQL not compatible to the one in PHP???
17504 by: DL Neil

Re: MSSQL2000
17505 by: Andrew Hill

Re: addslashes needed for db security? Hack proving webapps
17506 by: Aron Pilhofer

Re: multiple select statements
17507 by: Aron Pilhofer

Re: RC4 encryption with PHP
17509 by: bill

php mssql* functions
17514 by: Jeremy Reed

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

--- Begin Message ---

In article , Randy Rankin wrote:
> Based on the user selection, the 2nd
> drop down box would be populated with the distinct 'make' for that model
> (ie; if the user selects Ford in the first drop down, the 2nd drop down
> would be populated with Explorer, Expedition, Ranger, etc.).
>

something like SELECT Model FROM MyTable WHERE Manufacturer='Ford'

-- 
Rgds
Ralph



--- End Message ---
--- Begin Message ---

So, if the user selects "mercedes", then the next box is "500Sl, 300Sc" and
so forth. If they select ford, then the second box has completely different
values?

You'll either have to reload the page after the first select, or use
javascript or some other kind of client script. I don't think there is a way
to do it with PHP, but maybe someone else has an idea to help you. I hope
they do, because I need to do the same sort of thing, and I am trying to
avoid js at all costs.



"Randy Rankin" <[EMAIL PROTECTED]> wrote in message
F3BF649E168BD411A1B700010271F38BB4BD20@SBMAIL">news:F3BF649E168BD411A1B700010271F38BB4BD20@SBMAIL...
> Does anyone know how I might populate a drop down box based on the users
> selection from a previous drop down box? For example, if I have a table
> called 'autos' with 2 fields, 'make' and 'model'. I select distinct 'make'
> and populate the first drop down box. Based on the user selection, the 2nd
> drop down box would be populated with the distinct 'make' for that model
> (ie; if the user selects Ford in the first drop down, the 2nd drop down
> would be populated with Explorer, Expedition, Ranger, etc.).
>
> Thanks,
>
> Randy Rankin
>



--- End Message ---
--- Begin Message ---

On 3/5/02 3:34 PM, "Leotta, Natalie (NCI/IMS)" <[EMAIL PROTECTED]>
wrote:

> This can be done with JavaScript - I don't know if you can do it in PHP.

...unless the drop-downs are on separate pages.  E.g.: page 1 just asks for
make, once selected, load up page 2 with choices appropriate to the first
drop down.  Certainly, javascript is cooler.
-- 
Ed Marczak
[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---

If they want two pages they wouldn't need JS though - just submit and use
that in your second query to populate drop-down #2.  I had assumed that they
wanted it on the same page - which is definitely cooler :-)  Good point
though - I should have asked which way they wanted to do it.  I suppose if
you really wanted to be able to say your site used JS you could still use it
to set a hidden value in the form and submit it to the next page that way.

-Natalie

> -Original Message-
> From: Edward Marczak [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, March 06, 2002 10:27 AM
> To:   [EMAIL PROTECTED]
> Subject:  Re: [PHP-DB] Dynamic Drop Down Box
> 
> On 3/5/02 3:34 PM, "Leotta, Natalie (NCI/IMS)" <[EMAIL PROTECTED]>
> wrote:
> 
> > This can be done with JavaScript - I don't know if you can do it in PHP.
> 
> ...unless the drop-downs are on separate pages.  E.g.: page 1 just asks
> for
> make, once selected, load up page 2 with choices appropriate to

[PHP-DB] OCI8 issue (and some apc too): configure bugs?

2002-03-06 Thread Diego Francisco de Gastal Morales

Hello all,

I've read several messages and articles about php/oci8 combination, but I
still have some issues not resolved.

On this system:
Debian (stable), PHP 4.0.6, Oracle 8.1.7, Apache 1.3.9-14, 
I compile php like this:

#Begin
ORACLE_HOME=/oracle/product/8.1.7

./configure \
--prefix=/usr \
--with-apxs \
--with-config-file-path=/etc/php4/apache \
--with-gd=shared \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--enable-gd-native-ttf \
--enable-apc \
--enable-inline-optimization \
--with-oci8=${ORACLE_HOME} | 
tee /tmp/phpbuild.log

make | tee -a /tmp/phpbuild.log

make install | tee -a /tmp/phpbuild.log
#End

I ran phpize on ext/oci8 and also ran autoconf on top level of the source
tree, before that.

The problem is that it doesn't build the oci8.so and php_apc.so in the
modules directory! 

Anybody knows why that?

What I have already tried:

On the ext source tree I find the oci8.lo and php_apc.lo files. Then, first
I tried to rename them to .so. 

And put the following on apache initialization:

ORACLE_BASE=/oracle
ORACLE_HOME=/oracle/product/8.1.7
PATH=$PATH:$ORACLE_HOME/bin
ORA_NLS=$ORACLE_HOME/ocommon/nls/admin/data
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
NLS_LANG="BRAZILIAN PORTUGUESE_BRAZIL.WE8ISO8859P1"
NLS_LANG33=$ORACLE_HOME/ocommon/nls/admin/data
LD_PRELOAD=$ORACLE_HOME/lib/libclntsh.so.8.0
LD_LIBRARY_PATH=/lib:/usr/lib:$ORACLE_HOME/lib
unset LANG

export (...all of them)

Result: APC works fine, and so OCI8, BUT...
on apache error.log it tells me oci8 could not be loaded. ("ELF file's
phentsize not the expected size in Unknown on line 0") 
Things are working probably just because of the LD_PRELOAD line above.

I've tried then to generate the .so in the right way:
cc -shared -o oci8.so oci8.lo (is it the right way?)
Now apache tells me that oci8.so is a "invalid library (maybe not a PHP
library) on Unknown line 0"

I just want to understand, can somebody help me understand it?

Thank you in advance,

Diego Morales.

--
Diego Francisco de Gastal Morales
Técnico em Informática
Equipe de Redes - DI
Tribunal de Justiça do RS



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




RE: [PHP-DB] Dynamic Drop Down Box

2002-03-06 Thread Boaz Yahav

There are several examples on http://www.weberdev.com.
Look in the Java Script area.

Sincerely

  berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.


-Original Message-
From: Rankin, Randy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 05, 2002 10:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Dynamic Drop Down Box


Does anyone know how I might populate a drop down box based on the users
selection from a previous drop down box? For example, if I have a table
called 'autos' with 2 fields, 'make' and 'model'. I select distinct
'make'
and populate the first drop down box. Based on the user selection, the
2nd
drop down box would be populated with the distinct 'make' for that model
(ie; if the user selects Ford in the first drop down, the 2nd drop down
would be populated with Explorer, Expedition, Ranger, etc.).

Thanks,

Randy Rankin

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




RE: [PHP-DB] Difficulty on how to extract data out of a text withstring functions.

2002-03-06 Thread Gurhan Ozen

Yeah it is getting really off the topic i will email you in private.. :)

Gurhan
-Original Message-
From: Andy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 3:28 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Difficulty on how to extract data out of a text
with string functions.


Hello Gurhan,

thanx for your help. You are right, the file is not consistent. But some
things are. For example that every line contains

one data set and that every line begins with the name of the column I would
like to have followed by a :

I could yous win32, linux rh72 and osx to do this. The question is what
would be the fastest way.

I never heared of unix shell scripting, but I asume it is something what
youwould call a batch file in win or apple script on mac.

Thanx again for your help.

Andy


"Gurhan Ozen" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Andy,
> The little snippet you showed from the text file made me think that the
data
> layout for each  country is not consistent.
> For example:
> For Algeria there is the country name and right underneath goes the info
> about yellow fever and malaria as opposed to American Samoa where
underneath
> the country name is capital and altitude.. IS this the case? If it is, can
> you reorganize the data to be consistent and even same number of lines for
> each country? IT will make you life heck a lot easier to have a pretty
> consistent data layout to do what you need to do...
>  In addition, can you tell us what OS yo are using? I don't know if PH is
> the best and/or right choice to do this, but if you are in *NIX shell
> scripting can be useful.
>   Thanks..
>
> Gurhan
>
> -Original Message-
> From: Andy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 06, 2002 1:50 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP-DB] Difficulty on how to extract data out of a text with
> string functions.
>
>
> Hi there,
>
> I want to include some data into my website which covers malaria and
yellow
> feewer related to each country. On the WHO website are all the infos I
need.
> Their webmaster told me that unfortunatelly there is no db behind that and
> everything gos with html files. But I am free to extract that data.
>
> Well, I did create a txt file which looks more or less like that:
>
> ALGERIA
> Yellow fever: A yellow fever vaccination certificate is required from
> travellers over 1 year of age coming from infected areas.
> Malaria: Malaria risk is limited. One small focus (P. vivax) has been
> reported in Ihrir (Illizi Department), but this is isolated and access is
> difficult.
> Recommended prophylaxis: none.
>
> AMERICAN SAMOA
> Capital: Pago Pago
> Altitude: 10 m
> Yellow fever: A yellow fever vaccination certificate is required from
> travellers over 1 year of age coming from infected areas.
>
> Now I have a table in a MySQL db naming all those countries. The goal is
to
> extract the Yellow fever and Malaria line and put it into a mysql table
> related to the countries.
>
> I saw that PHP has some good functions on text, but do u guys think this
> could be done??? Doing it by hand could take alng loong while.
>
> I am open for any idea!
>
> Thanx a lot for any help
>
> Cheers, Andy
>
>
>
> --
> 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] records into an editable box

2002-03-06 Thread Shrock, Court

do you mean something like:

\n";
?>

of course, the output above would need to be inside an html form.

> -Original Message-
> From: jas [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 05, 2002 11:35 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] records into an editable box
> 
> 
> How would I change this sql statement to pull the db table 
> and display it
> within an editable box within a form?  Any help or tutorials 
> would be great.
>  $result = mysql_query("SELECT $table FROM $field",$dbh) or 
> die("Could not
> execute query, please try again later");
> echo "text:\n";
> printf(mysql_result($result,"wel_area"));
> ?>
> Thanks in advance,
> Jas
> 
> 
> 
> -- 
> 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




Re: [PHP-DB] records into an editable box

2002-03-06 Thread jas

No dan I mean textbox... but I am assuming you dont have any idea where a
good tutorial would be then.  Thanks anyways.
Jas
"Dan Brunner" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello!!
>
> Do you mean a textarea??
>
> And you want to populate the "textarea" with the data, right?
>
>
> Dan
>
>
> On Wednesday, March 6, 2002, at 01:34 AM, [EMAIL PROTECTED] wrote:
>
> > How would I change this sql statement to pull the db table and display
> > it
> > within an editable box within a form?  Any help or tutorials would be
> > great.
> >  > $result = mysql_query("SELECT $table FROM $field",$dbh) or die("Could
> > not
> > execute query, please try again later");
> > echo "text:\n";
> > printf(mysql_result($result,"wel_area"));
> > ?>
> > Thanks in advance,
> > Jas
> >
> >
> >
> > --
> > 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




Re: [PHP-DB] Difficulty on how to extract data out of a text with string functions.

2002-03-06 Thread Andy

Hello Gurhan,

thanx for your help. You are right, the file is not consistent. But some
things are. For example that every line contains

one data set and that every line begins with the name of the column I would
like to have followed by a :

I could yous win32, linux rh72 and osx to do this. The question is what
would be the fastest way.

I never heared of unix shell scripting, but I asume it is something what
youwould call a batch file in win or apple script on mac.

Thanx again for your help.

Andy


"Gurhan Ozen" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Andy,
> The little snippet you showed from the text file made me think that the
data
> layout for each  country is not consistent.
> For example:
> For Algeria there is the country name and right underneath goes the info
> about yellow fever and malaria as opposed to American Samoa where
underneath
> the country name is capital and altitude.. IS this the case? If it is, can
> you reorganize the data to be consistent and even same number of lines for
> each country? IT will make you life heck a lot easier to have a pretty
> consistent data layout to do what you need to do...
>  In addition, can you tell us what OS yo are using? I don't know if PH is
> the best and/or right choice to do this, but if you are in *NIX shell
> scripting can be useful.
>   Thanks..
>
> Gurhan
>
> -Original Message-
> From: Andy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 06, 2002 1:50 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP-DB] Difficulty on how to extract data out of a text with
> string functions.
>
>
> Hi there,
>
> I want to include some data into my website which covers malaria and
yellow
> feewer related to each country. On the WHO website are all the infos I
need.
> Their webmaster told me that unfortunatelly there is no db behind that and
> everything gos with html files. But I am free to extract that data.
>
> Well, I did create a txt file which looks more or less like that:
>
> ALGERIA
> Yellow fever: A yellow fever vaccination certificate is required from
> travellers over 1 year of age coming from infected areas.
> Malaria: Malaria risk is limited. One small focus (P. vivax) has been
> reported in Ihrir (Illizi Department), but this is isolated and access is
> difficult.
> Recommended prophylaxis: none.
>
> AMERICAN SAMOA
> Capital: Pago Pago
> Altitude: 10 m
> Yellow fever: A yellow fever vaccination certificate is required from
> travellers over 1 year of age coming from infected areas.
>
> Now I have a table in a MySQL db naming all those countries. The goal is
to
> extract the Yellow fever and Malaria line and put it into a mysql table
> related to the countries.
>
> I saw that PHP has some good functions on text, but do u guys think this
> could be done??? Doing it by hand could take alng loong while.
>
> I am open for any idea!
>
> Thanx a lot for any help
>
> Cheers, Andy
>
>
>
> --
> 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




Re: [PHP-DB] records into an editable box

2002-03-06 Thread Dan Brunner

Hello!!

Do you mean a textarea??

And you want to populate the "textarea" with the data, right?


Dan


On Wednesday, March 6, 2002, at 01:34 AM, [EMAIL PROTECTED] wrote:

> How would I change this sql statement to pull the db table and display 
> it
> within an editable box within a form?  Any help or tutorials would be 
> great.
>  $result = mysql_query("SELECT $table FROM $field",$dbh) or die("Could 
> not
> execute query, please try again later");
> echo "text:\n";
> printf(mysql_result($result,"wel_area"));
> ?>
> Thanks in advance,
> Jas
>
>
>
> --
> 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




Re: [PHP-DB] Re: Dynamic Drop Down Box

2002-03-06 Thread Bill Morrow

I haven't actually tried this, but if you use frames, could you submit
from the first dropdown and refresh the second if they are in seperate frames?

Not that I'd like to support that code.

On Wed, Mar 06, 2002 at 10:14:59AM -0800, fls wrote:
> I've got a dynamic dropdown on http://www.northjerseydirectories.com
> I generate the js using php and a MySQL database.  The dropdown does what
> you're looking for.  Since the dropdown is client side you either need to
> go with javascript, an applet, or have the person submit a form that loads
> the second box which is pretty clumsy.
> Fred Steinkopf
> 
> On Wed, 6 Mar 2002, Aron Pilhofer wrote:
> 
> > So, if the user selects "mercedes", then the next box is "500Sl, 300Sc" and
> > so forth. If they select ford, then the second box has completely different
> > values?
> >
> > You'll either have to reload the page after the first select, or use
> > javascript or some other kind of client script. I don't think there is a way
> > to do it with PHP, but maybe someone else has an idea to help you. I hope
> > they do, because I need to do the same sort of thing, and I am trying to
> > avoid js at all costs.
> >
> >
> >
> > "Randy Rankin" <[EMAIL PROTECTED]> wrote in message
> > F3BF649E168BD411A1B700010271F38BB4BD20@SBMAIL">news:F3BF649E168BD411A1B700010271F38BB4BD20@SBMAIL...
> > > Does anyone know how I might populate a drop down box based on the users
> > > selection from a previous drop down box? For example, if I have a table
> > > called 'autos' with 2 fields, 'make' and 'model'. I select distinct 'make'
> > > and populate the first drop down box. Based on the user selection, the 2nd
> > > drop down box would be populated with the distinct 'make' for that model
> > > (ie; if the user selects Ford in the first drop down, the 2nd drop down
> > > would be populated with Explorer, Expedition, Ranger, etc.).
> > >
> > > Thanks,
> > >
> > > Randy Rankin
> > >
> >
> >
> >
> > --
> > 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] records into an editable box

2002-03-06 Thread jas

How would I change this sql statement to pull the db table and display it
within an editable box within a form?  Any help or tutorials would be great.
text:\n";
printf(mysql_result($result,"wel_area"));
?>
Thanks in advance,
Jas



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




RE: [PHP-DB] Difficulty on how to extract data out of a text withstring functions.

2002-03-06 Thread Gurhan Ozen

Hi Andy,
The little snippet you showed from the text file made me think that the data
layout for each  country is not consistent.
For example:
For Algeria there is the country name and right underneath goes the info
about yellow fever and malaria as opposed to American Samoa where underneath
the country name is capital and altitude.. IS this the case? If it is, can
you reorganize the data to be consistent and even same number of lines for
each country? IT will make you life heck a lot easier to have a pretty
consistent data layout to do what you need to do...
 In addition, can you tell us what OS yo are using? I don't know if PH is
the best and/or right choice to do this, but if you are in *NIX shell
scripting can be useful.
  Thanks..

Gurhan

-Original Message-
From: Andy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 1:50 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Difficulty on how to extract data out of a text with
string functions.


Hi there,

I want to include some data into my website which covers malaria and yellow
feewer related to each country. On the WHO website are all the infos I need.
Their webmaster told me that unfortunatelly there is no db behind that and
everything gos with html files. But I am free to extract that data.

Well, I did create a txt file which looks more or less like that:

ALGERIA
Yellow fever: A yellow fever vaccination certificate is required from
travellers over 1 year of age coming from infected areas.
Malaria: Malaria risk is limited. One small focus (P. vivax) has been
reported in Ihrir (Illizi Department), but this is isolated and access is
difficult.
Recommended prophylaxis: none.

AMERICAN SAMOA
Capital: Pago Pago
Altitude: 10 m
Yellow fever: A yellow fever vaccination certificate is required from
travellers over 1 year of age coming from infected areas.

Now I have a table in a MySQL db naming all those countries. The goal is to
extract the Yellow fever and Malaria line and put it into a mysql table
related to the countries.

I saw that PHP has some good functions on text, but do u guys think this
could be done??? Doing it by hand could take alng loong while.

I am open for any idea!

Thanx a lot for any help

Cheers, Andy



--
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] Difficulty on how to extract data out of a text with string functions.

2002-03-06 Thread Erik Price


On Wednesday, March 6, 2002, at 01:49  PM, Andy wrote:

> I want to include some data into my website which covers malaria and 
> yellow
> feewer related to each country.

To each his own, I suppose...

> Now I have a table in a MySQL db naming all those countries. The goal 
> is to
> extract the Yellow fever and Malaria line and put it into a mysql table
> related to the countries.
>
> I saw that PHP has some good functions on text, but do u guys think this
> could be done??? Doing it by hand could take alng loong 
> while.

You've got the right idea to write a script that can enter the data into 
the database, but PHP may not be the best language to do it.  PHP is 
especially good at extracting data from text files or a database and 
then displaying it as HTML or any other format.  If you want to enter 
the data into the database, take a look at the mysqlimport utility 
(which comes with most MySQL distributions).
What I would do is write a Perl script that runs through the text file 
you made, and rearranges the data to be more acceptable to mysqlimport 
(I think mysqlimport requires its input in tab-delimited format).  You 
could either write this rearranged data to a new file and run 
mysqlimport on that, or in Unix you can pipe the output from the Perl 
script directly to mysqlimport.

The hard part is really going to be writing the Perl script, but I bet 
it won't be very hard.  It really depends on how the data in your text 
file is arranged -- i.e., is it consistent, or random?  I'm hoping that 
the actual file is a little more consistent than the examples you 
provided (i.e., not every entry has a "malaria" line or "yellow fever" 
line, and some entries have "altitudes" and "capitals" while others 
don't.

If it's consistent, a Perl guru could probably help you with little 
trouble -- check out www.perlmonks.org.  (Sorry, but I am far from a 
Perl guru.)

Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP-DB] Difficulty on how to extract data out of a text with string functions.

2002-03-06 Thread Andy

Hi there,

I want to include some data into my website which covers malaria and yellow
feewer related to each country. On the WHO website are all the infos I need.
Their webmaster told me that unfortunatelly there is no db behind that and
everything gos with html files. But I am free to extract that data.

Well, I did create a txt file which looks more or less like that:

ALGERIA
Yellow fever: A yellow fever vaccination certificate is required from
travellers over 1 year of age coming from infected areas.
Malaria: Malaria risk is limited. One small focus (P. vivax) has been
reported in Ihrir (Illizi Department), but this is isolated and access is
difficult.
Recommended prophylaxis: none.

AMERICAN SAMOA
Capital: Pago Pago
Altitude: 10 m
Yellow fever: A yellow fever vaccination certificate is required from
travellers over 1 year of age coming from infected areas.

Now I have a table in a MySQL db naming all those countries. The goal is to
extract the Yellow fever and Malaria line and put it into a mysql table
related to the countries.

I saw that PHP has some good functions on text, but do u guys think this
could be done??? Doing it by hand could take alng loong while.

I am open for any idea!

Thanx a lot for any help

Cheers, Andy



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




RE: [PHP-DB] I have a " in my db ?

2002-03-06 Thread Gurhan Ozen

Hi,
Can u please give us more information?? Are you trying to insert data into
database or pull data out of database.. Also can you show the queries you
are using???
Thanks,

Gurhan


-Original Message-
From: Dave carrera [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 12:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] I have a " in my db ?


Hi All



I think this has something to do with either



Stripslashes or Addslashes but which one. And where do I use it.



I have a product that has a " in the name and I have created a drop down
list from the names.



I cant get it to reg the name. all it reg is 15" instead of th full name
which is 15" lcd Monitor.



How do I get past this issue



The php manual has no usage examples relevant to my needs.



Please help



Dave c



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




Re: [PHP-DB] Re: Dynamic Drop Down Box

2002-03-06 Thread fls

I've got a dynamic dropdown on http://www.northjerseydirectories.com
I generate the js using php and a MySQL database.  The dropdown does what
you're looking for.  Since the dropdown is client side you either need to
go with javascript, an applet, or have the person submit a form that loads
the second box which is pretty clumsy.
Fred Steinkopf

On Wed, 6 Mar 2002, Aron Pilhofer wrote:

> So, if the user selects "mercedes", then the next box is "500Sl, 300Sc" and
> so forth. If they select ford, then the second box has completely different
> values?
>
> You'll either have to reload the page after the first select, or use
> javascript or some other kind of client script. I don't think there is a way
> to do it with PHP, but maybe someone else has an idea to help you. I hope
> they do, because I need to do the same sort of thing, and I am trying to
> avoid js at all costs.
>
>
>
> "Randy Rankin" <[EMAIL PROTECTED]> wrote in message
> F3BF649E168BD411A1B700010271F38BB4BD20@SBMAIL">news:F3BF649E168BD411A1B700010271F38BB4BD20@SBMAIL...
> > Does anyone know how I might populate a drop down box based on the users
> > selection from a previous drop down box? For example, if I have a table
> > called 'autos' with 2 fields, 'make' and 'model'. I select distinct 'make'
> > and populate the first drop down box. Based on the user selection, the 2nd
> > drop down box would be populated with the distinct 'make' for that model
> > (ie; if the user selects Ford in the first drop down, the 2nd drop down
> > would be populated with Explorer, Expedition, Ranger, etc.).
> >
> > Thanks,
> >
> > Randy Rankin
> >
>
>
>
> --
> 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] Bindbyname error in solaris

2002-03-06 Thread Mohammad Saad

Hello
I have PHP4.10 on solaris with oci8 support. everything seems to work 
well. Oracle support is working fine. but I am getting an error when I 
am trying OCIBindByName to bind a variable to an out variable of a 
stored procedure. 
I have checked this code on php4.10 on windows 2k with same database 
and it works well. I get the value of the out variable in my binded 
variable of PHP script.
.Only PHP on solaris is giving me the error, any ideas why? here is the 
code and the error

$getcardvalidity = "begin customer.scratch_check
('$serial','$code1','$code2',:amount);end;"; 
$cardstmt = OCIParse($conn,$getcardvalidity);
OCIBindByName ( $cardstmt, ":amount", &$amount,4);
OCIExecute($cardstmt,OCI_DEFAULT);

Warning: OCIStmtExecute: Error while trying to retrieve text for error 
ORA-03113 

and this code works well when i run same script on php installed on 
win2k but i have to make it run on solaris.
Thanks in advance 
Saad


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




Re: [PHP-DB] Secure PHP to remote Sybase server

2002-03-06 Thread William Fong

We were discussing this issue over in #php at irc.openprojects.net.  I
wasn't there for the whole conversation, but what was discussed was that
there was no built-in encryption and that the only way to achieve this was
with an SSL tunnel

What I have done with MySQL is setup a user that can only login from the Web
box (restricted by IP).  So even if anyone found out the password, they
wouldn't be able to use it.  Maybe you could do the same thing?

-w

--
William Fong - [EMAIL PROTECTED]
Phone: 626.968.6424 x210  |  Fax: 626.968.6877
Wireless #: 805.490.7732|  Wireless E-mail: [EMAIL PROTECTED]




- Original Message -
From: "Dennis Khaw" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 06, 2002 9:33 AM
Subject: [PHP-DB] Secure PHP to remote Sybase server


: Hi Everyone,
:
: This is the setup: A front-end Sun Solaris 8 server running Apache and
: mod php. A second server running Solaris 8 and Sybase.
:
: Clients with a web browser connects to the front-end server and submit a
: query. Apache/php then opens a remote connection to Sybase on the second
: server using the function  sybase_connect("server". "dbuser",
: "password") and processes the query. Everything works well. However, the
: problem is that the dbuser password is sent cleartext across the wire.
:
: Is there a way to setup a secure connection between the 2 servers, or at
: least have the dbuser's password encrypted?
:
: Thanks.
:
: Dennis
:
:
: --
: 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] Secure PHP to remote Sybase server

2002-03-06 Thread Dennis Khaw

Hi Everyone,

This is the setup: A front-end Sun Solaris 8 server running Apache and
mod php. A second server running Solaris 8 and Sybase.

Clients with a web browser connects to the front-end server and submit a
query. Apache/php then opens a remote connection to Sybase on the second
server using the function  sybase_connect("server". "dbuser",
"password") and processes the query. Everything works well. However, the
problem is that the dbuser password is sent cleartext across the wire.

Is there a way to setup a secure connection between the 2 servers, or at
least have the dbuser's password encrypted?

Thanks.

Dennis


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




[PHP-DB] I have a " in my db ?

2002-03-06 Thread Dave carrera

Hi All

 

I think this has something to do with either

 

Stripslashes or Addslashes but which one. And where do I use it.

 

I have a product that has a " in the name and I have created a drop down
list from the names.

 

I cant get it to reg the name. all it reg is 15" instead of th full name
which is 15" lcd Monitor.

 

How do I get past this issue

 

The php manual has no usage examples relevant to my needs.

 

Please help

 

Dave c




Re: [PHP-DB] 2 mysql connections to same server?

2002-03-06 Thread William Fong

I've never tried this before, but couldn't you use $db1 = mysql_connect();
and $db2 = mysql_connect();?


--
William Fong - [EMAIL PROTECTED]
Phone: 626.968.6424 x210  |  Fax: 626.968.6877
Wireless #: 805.490.7732|  Wireless E-mail: [EMAIL PROTECTED]




- Original Message -
From: "Tom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 05, 2002 1:46 PM
Subject: [PHP-DB] 2 mysql connections to same server?


: Hi,
:
: does anyone know how to make multiple database connections to the same
: server without getting the same Resource-ID back from the "mysql_connect"
?
:
: I´m trying to write an abstract database class. I want to be able to have
: different instances for every connection. For example one connection for
: session handling and another one for normal database interaction. But
: connecting to the same server (different database) a second time kinda
: overwrites my previos connection and gives back the same resource id.
:
: Thanks for help,
: Tom
:
:
:
: --
: 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] php mssql* functions

2002-03-06 Thread Jeremy Reed

Because of the limitations of MS SQL Server and the inability to limit
result sets as you are in MySQL, I am having to finesse/brute force a method
to peruse through large result sets.

My question is this:  How exactly does the mssql_fetch_array() function
work?  Does it make a call to the db server for each fetch, or is the entire
result set returned from the db server and stored locally in memory and the
fetch call just pulls it from there?

I suppose it makes little difference in the final design, since I'll need to
have the functionality anyway, I was just curious about what kind of
overhead I'd be creating.

Thanks,

Jeremy



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




Re: [PHP-DB] Dynamic Drop Down Box

2002-03-06 Thread Paul Burney

on 3/6/02 10:31 AM, Leotta, Natalie (NCI/IMS) at [EMAIL PROTECTED]
appended the following bits to my mbox:

> If they want two pages they wouldn't need JS though - just submit and use
> that in your second query to populate drop-down #2.  I had assumed that they
> wanted it on the same page - which is definitely cooler :-)  Good point
> though - I should have asked which way they wanted to do it.  I suppose if
> you really wanted to be able to say your site used JS you could still use it
> to set a hidden value in the form and submit it to the next page that way.

I figured I'd throw something in too.

I personally don't like the client side scripting option because it
adversely affects accessibility.  If you choose the client side option, you
should also have a non JavaScript version as well (the 2 pages mentioned
before) for site visitors that have other types of interfaces that don't
understand JavaScript or for visitors that have dynamic scripting turned off
(not a bad idea these days with all the XSS cookie stealing stuff).

That said, WebReference has a great tutorial and a bunch of code that you
can use to make the nifty related drop-down menus.  You can see the theory
and tutorial here:



And they even have a script that'll generate the code for you here:



Hope that helps.

Sincerely,

Paul Burney
http://paulburney.com/

http://security.e-matters.de/advisories/012002.html> */

?>


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




Re: [PHP-DB] MySQL_connect

2002-03-06 Thread Josh Trutwin

> On Wednesday 06 March 2002 15:53, [EMAIL PROTECTED] wrote:
>
>> Hi,
>>
>> I'm new to MySql, when I try to connect my PHP-script with
>> mysql_connect($host, $user, $pass)
>> my script returns the error
>> "Fatal error: Call to undefined function: mysql_connect()"
>> I have given the user all rights in MySQL, both on host, DB, tables,
>> and fields
>>
>> This might be easy for you, but I'm stuck..any help / comments are
>> appreciated
>
> It means you do not have mysql support in PHP. If you compiled PHP
> yourself,  recompile it to include mysql support. If you installed it
> via RPM then look  for the appropriate RPMs from distro vendor.

A great way to check this is to create a simple script called phpinfo.php
with just this line in it, place it in your top level web directory:



Point your browser to http://localhost/phpinfo.php (assuming the computer
you are using is your web server)  You should see the ./configure command
used to compile PHP, look for --with-mysql.

Josh




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




RE: [PHP-DB] Dynamic Drop Down Box

2002-03-06 Thread Leotta, Natalie (NCI/IMS)

If they want two pages they wouldn't need JS though - just submit and use
that in your second query to populate drop-down #2.  I had assumed that they
wanted it on the same page - which is definitely cooler :-)  Good point
though - I should have asked which way they wanted to do it.  I suppose if
you really wanted to be able to say your site used JS you could still use it
to set a hidden value in the form and submit it to the next page that way.

-Natalie

> -Original Message-
> From: Edward Marczak [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, March 06, 2002 10:27 AM
> To:   [EMAIL PROTECTED]
> Subject:  Re: [PHP-DB] Dynamic Drop Down Box
> 
> On 3/5/02 3:34 PM, "Leotta, Natalie (NCI/IMS)" <[EMAIL PROTECTED]>
> wrote:
> 
> > This can be done with JavaScript - I don't know if you can do it in PHP.
> 
> ...unless the drop-downs are on separate pages.  E.g.: page 1 just asks
> for
> make, once selected, load up page 2 with choices appropriate to the first
> drop down.  Certainly, javascript is cooler.
> -- 
> Ed Marczak
> [EMAIL PROTECTED]
> 
> 
> -- 
> 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




Re: [PHP-DB] Dynamic Drop Down Box

2002-03-06 Thread Edward Marczak

On 3/5/02 3:34 PM, "Leotta, Natalie (NCI/IMS)" <[EMAIL PROTECTED]>
wrote:

> This can be done with JavaScript - I don't know if you can do it in PHP.

...unless the drop-downs are on separate pages.  E.g.: page 1 just asks for
make, once selected, load up page 2 with choices appropriate to the first
drop down.  Certainly, javascript is cooler.
-- 
Ed Marczak
[EMAIL PROTECTED]


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




[PHP-DB] Re: RC4 encryption with PHP

2002-03-06 Thread bill

Might be late, but here's what I have working.

"Troy A. Delagardelle" wrote:

> I am trying to encrypt a credit card number using rc4 and php and then dump
> it into a mySql database.  Does anyone have any sample code that allows me
> to do this??
>
> I found the Class.RC4Crypt algorithm and would like to use that.  When I
> include the class.rc4crypt.php the page dies...
>
> Here is my code...
>
>  // encrypt the credit card number here.
>
> include("class.rc4crypt.php");
>
> $pass = $whatever;
> $data = $cardInfo['number'];
> $case ='de';

$case should be 'en' for encrypting.

> $rc4 = new rc4crypt;
> $encrypt_CC = endecrypt($pass, $data, $case);

Use this:

  $rc4 = new rc4crypt;
  $encrypt_CC=$rc4->endecrypt($pass, $data, "$case");
  $data="encrypted"; // don't leave it in memory

>
>
> then I will send $encrypt_CC to the DB..
>
> Any help would be greatly appreciated..thx  Troy


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




[PHP-DB] Re: Dynamic Drop Down Box

2002-03-06 Thread Aron Pilhofer

So, if the user selects "mercedes", then the next box is "500Sl, 300Sc" and
so forth. If they select ford, then the second box has completely different
values?

You'll either have to reload the page after the first select, or use
javascript or some other kind of client script. I don't think there is a way
to do it with PHP, but maybe someone else has an idea to help you. I hope
they do, because I need to do the same sort of thing, and I am trying to
avoid js at all costs.



"Randy Rankin" <[EMAIL PROTECTED]> wrote in message
F3BF649E168BD411A1B700010271F38BB4BD20@SBMAIL">news:F3BF649E168BD411A1B700010271F38BB4BD20@SBMAIL...
> Does anyone know how I might populate a drop down box based on the users
> selection from a previous drop down box? For example, if I have a table
> called 'autos' with 2 fields, 'make' and 'model'. I select distinct 'make'
> and populate the first drop down box. Based on the user selection, the 2nd
> drop down box would be populated with the distinct 'make' for that model
> (ie; if the user selects Ford in the first drop down, the 2nd drop down
> would be populated with Explorer, Expedition, Ranger, etc.).
>
> Thanks,
>
> Randy Rankin
>



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




[PHP-DB] Re: multiple select statements

2002-03-06 Thread Aron Pilhofer

There are even easier ways to do it than that... using if statements. so,
start with something like this:

$query.="select ";

then let's say you have a buch of clickboxes which your user can check which
will construct your select statements, so,

if ($clickbox1="") {

$query.="";
}

if ($clickbox2="") {
$query.="";
}

then at the end: $query.="from ";

mysql_query($query)... and off you go...don't forget the little period,
otherwise it won't concat everything together as you build your query. If
you need to select from different tables, just add another variable to your
if statements..

If you want to see a real example, here's a snip I use to built an insert
statement, which will take any number of values from an array, create a
table based on their field names, and then insert them into that table..:

//start of insert...
$insert.="insert out_fuzzy set ";

   $count=$count+1;
//loops through array
   for ($i=0; $i<$cols_compare; $i++)
   {

$insert.=mysql_field_name($result_compare, $i);
$insert.="_compare=\"";
$insert.=$compare[$i];
$insert.="\", ";
$insert.=mysql_field_name($result_compare, $i);
$insert.="_base=\"";
$insert.=$result_base[$i];
$insert.="\", ";
$insert.=mysql_field_name($result_compare, $i);
$insert.="_pct=\"";
$base_tmp=trim(strtoupper($result_base[$i]));
$compare_tmp=trim(strtoupper($compare[$i]));
$number=similar_text($base_tmp, $compare_tmp, $last_sim);
$insert.=number_format($last_sim,1);
$insert.="\", ";

Hope that helps.

aron

"Lerp" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there :)
>
> You could construct seperate queries for every possible combination of
> search provided you don't have a huge number of search criteria (form
> elements for your search)
> .
> I did this just recently for a friend finder site. In the search the user
> has four fields that are automatically included in the search and three
more
> that are optional
>
> I built the sql queries based on every combination of the three optional
> search criterias. Since there are three optional search criterias the
number
> of queries to be built is 8 to compensate for every combination.
>
> This is one way to do it anyway:)
>
> Hope this helps you out, Joe :)
>
>
> 
> # stateprovince, country, and relationship are all optional therefor 8
> combinations for query -- use the other form values as well
>
>
> if(($country == "All") && ($stateprovince == "All") && ($relationship ==
> "All")){
>
> $sql = "SELECT friend_id, first_name, sex, age, city, province_state,
> country, relationship FROM FRIEND WHERE sex = '$sex' AND age BETWEEN
'$age1'
> AND '$age2' AND sexuality ='$sexuality' ORDER BY signupdate DESC";
> $searchcriteria = $sex . " " . $sexuality . " between the ages of " .
$age1
> . " and " . $age2;
> }
>
> elseif(($country != "All") && ($stateprovince == "All") && ($relationship
==
> "All")){
>
> $sql = "SELECT friend_id, first_name, sex, age, city, province_state,
> country, relationship FROM FRIEND WHERE sex = '$sex' AND age BETWEEN
'$age1'
> AND '$age2' AND sexuality ='$sexuality' AND country ='$country' ORDER BY
> signupdate DESC";
> $searchcriteria = $sex . " " . $sexuality . " between the ages of " .
$age1
> . " and " . $age2 . " from " . $country;
> }
>
>
> elseif(($country != "All") && ($stateprovince != "All") && ($relationship
==
> "All")){
>
> $sql = "SELECT friend_id, first_name, sex, age, city, province_state,
country, relationship FROM FRIEND WHERE sex = '$sex' AND age BETWEEN '$age1'
AND '$age2' AND sexuality ='$sexuality' AND country ='$country' AND
province_state ='$stateprovince' ORDER BY signupdate DESC";
> $searchcriteria
>  = $sex . " " . $sexuality . " between the ages of " . $age1 . " and " .
> $age2 . " from " . $stateprovince . ", " . $country;
>
> }
>
>
> elseif(($country != "All") && ($stateprovince != "All") && ($relationship
!=
> "All")){
>
> $sql = "SELECT friend_id, first_name, sex, age, city, province_state,
> country, relationship FROM FRIEND WHERE sex = '$sex' AND age BETWEEN
'$age1'
> AND '$age2' AND sexuality ='$sexuality' AND country ='$country' AND
> province_state ='$stateprovince' AND relationship ='$relationship' ORDER
BY
> signupdate DESC";
> $searchcriteria = $sex . " " . $sexuality . " between the ages of " .
$age1
> . " and " . $age2 . " from " . $stateprovince . ", " . $country . "
looking
> for " . $relationship . " relationship.";
>
> }
>
>
> elseif(($country == "All") && ($stateprovince != "All") && ($relationship
!=
> "All")){
>
> $sql = "SELECT friend_id, first_name, sex, age, city, province_state,
> country, relationship FROM FRIEND WHERE sex = '$sex' AND age BETWEEN
'$age1'
> AND '$age2'  AND sexuality ='$sexuality' AND province_state
> ='$stateprovince' AND relationship ='$relationship' ORDER BY signupdate
> DESC";
> $searchcriteria = $sex . " " . $sexuality . " between the ages of " .
$age1
> . " and " . $age2 . " from " . $stateprovince . " looking f

Re: [PHP-DB] addslashes needed for db security? Hack proving webapps

2002-03-06 Thread Aron Pilhofer

> Paul
>
>  while ($self != "asleep") {
> $sheep_count++;
> }
> ?>

I have nothing useful to add, except that I nearly spit up my morning coffee
laughing at your signature.



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




RE: [PHP-DB] MSSQL2000

2002-03-06 Thread Andrew Hill

Mike,

You can certainly use ODBC.  The drivers are already present on your system;
just configure a System DSN.

Best regards,
Andrew Hill
Director of Technology Evangelism
http://www.openlinksw.com/virtuoso/whatis.htm
OpenLink Virtuoso Internet Data Integration Server

> -Original Message-
> From: Mike [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 05, 2002 11:12 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] MSSQL2000
>
>
> Anybody able to get this working under a
>
> Windows2000 advanced server, IIS, PHP 4.1.1, MSSQL2000 SP2 all on one box
>
> I am beginning to believe it is not possible using any
> php_mssql.dll that i
> have ever found. correct me if anybody can.
>
>
>
> --
> 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] timestamp iin MySQL not compatible to the one in PHP???

2002-03-06 Thread DL Neil

Hi Andy
I apologise. The way I wrote the suggestion looks very much like a SQL
query doesn't it? It wasn't!
It would have been better expressed if I had said:

retrieve the MySQL timestamp field as a UNIX (epoch) timestamp, by using
the UNIX_TIMESTAMP function within the SELECT statement

> I tryed:
> $stmt= "
> SELECT first_name,  user_logindate , password
> FROM  $T5
> using UNIX_TIMESTAMP()
> WHERE user_id = '$user_id'
> LIMIT 1
> ";
>
> But is is returning an error.
>
> Do u know where the syntax error is? As I did understand u right...
first
> select with this kind of statement, then format it with date(xxx,
> $timestamp)

So to 'repair the damage', please try:

$stmt= "
SELECT first_name,  UNIX_TIMESTAMP( user_logindate ) AS login, password
FROM  $T5
WHERE user_id = '$user_id'
LIMIT 1
";

Manual reference: 6.3.4 Date and Time Functions

The 'login' value, once fetched from the resultset, may then be fed to
PHP's DATE() (date function - see earlier msg below, manual reference
http://www.php.net/manual/en/function.date.php) and presented in any
suitably user-friendly format.

Ok now?
=dn


> > So what is the proper function in PHP to convert the MySQL timestamp
> into a
> > proper format like Sonday, Apr. 20th 2002?
>
> SELECT from SQL using UNIX_TIMESTAMP()
>
> Format for presentation in PHP using: string date ( string format [,
int
> timestamp])
>
> Regards,
> =dn
>
>
> > > > I am playing around with the timestamp functions. I created a
> timestamp
> > > > with mysql ( the row is timestamp)
> > > > and do reformat this thing after selecting with php in the
> folowíng way:
> > > >
> > > >  $date_posted[$i] = strftime("%A, %d-%m-%Y %R",
$date_posted[$i]);
> > > >
> > > > This always returns Tuesday, 19-01-2038 but the mysql timestamp
> says:
> > > > 20020305211704
> > >
> > > They return the time in different formats. Read the MySQL manual
> then read
> > > the PHP manual (or vice-versa).
> > >
> > > The MySQL timestamp is human readable. So in your example above:
> > >
> > > 20020305211704 ==> 2002-03-05 21:17:04
> > >
> > > time() in PHP is the number of seconds since the Unix Epoch.


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




Re: [PHP-DB] how to make multiple in a coloum in mysql DB

2002-03-06 Thread DL Neil

Yoga,
wa aleikum as-salaam (tr: greetings returned to you)

> salam,
> i'm make a database in mysql, example :
> namescore Ascore A   Total
> john  7890
> mike  9070
> etc...
> ask me is:
> how to make multiple or total in coulum "Total"
> otomatically, if me input score in coulom total.
> please help me...
> (i am sorry my english)


Please don't feel it necessary to apologise for language difficulties.
The list language is English - and yet most of the MySQL AB people don't
speak English as their native-tongue, so ...

May I assume that the second 'score' column is labeled 'score B'?

There are two answers!

The answer to your specific question is that when you gather the data
(presumably an HTML form to PHP), after data-verification checks on
$scoreA and $scoreB, compute:

$total = $scoreA + $scoreB;

then formulate the INSERT statement accordingly.

However unless there are clear performance reasons for doing this, you
should not store "Totals" in a relation/table because the values in this
column are derived (and re-derivable) from the scores - and every time
you add a new score, the Total column would need to be changed. Better
to (only) store the scores in the table, and calculate the totals when
you retrieve the records later, eg

SELECT name, scoreA, scoreB, scoreA+scoreB AS Total FROM...

Unfortunately that comment on 'normalising' the table may also apply to
the scores themselves - should each score/result be held on its own row,
rather than having x-columns across the table. SQL/relational theory
doesn't work well this way around ('across', it prefers to go 'down') -
but that's another question.

Fee aman 'illah, (tr: go with God)
=dn


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




Re: [PHP-DB] how to make multiple in a coloum in mysql DB

2002-03-06 Thread Markus Lervik

On Wed, 2002-03-06 at 10:02, Yoga Anak Medan wrote:
> salam,
> i'm make a database in mysql, example :
> namescore Ascore A  Total
> john  7890
> mike  9070
> etc...
> ask me is:
> how to make multiple or total in coulum "Total"
> otomatically, if me input score in coulom total.
> please help me...
> (i am sorry my english)

INSERT INTO table VALUES("john", "78", "90", scoreA+scoreB);


Cheers,
Markus

-- 
Markus Lervik
Linux-administrator with a kungfoo grip
Vaasa City Library - Regional Library
[EMAIL PROTECTED]
+358-6-325 3589 / +358-40-832 6709


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




Re: [PHP-DB] MySQL_connect

2002-03-06 Thread Jason Wong

On Wednesday 06 March 2002 15:53, [EMAIL PROTECTED] wrote:

> Hi,
>
> I'm new to MySql, when I try to connect my PHP-script with
> mysql_connect($host, $user, $pass)
> my script returns the error
> "Fatal error: Call to undefined function: mysql_connect()"
> I have given the user all rights in MySQL, both on host, DB, tables, and
> fields
>
> This might be easy for you, but I'm stuck..any help / comments are
> appreciated

It means you do not have mysql support in PHP. If you compiled PHP yourself, 
recompile it to include mysql support. If you installed it via RPM then look 
for the appropriate RPMs from distro vendor.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Sometime when you least expect it, Love will tap you on the shoulder...
and ask you to move out of the way because it still isn't your turn.
-- N.V. Plyter
*/

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