Re: [PHP-DB] need help with foreach()

2003-03-09 Thread Jason Wong
On Monday 10 March 2003 08:10, David Rice wrote:
> Hey thank's for the ideas but  neither of them work, doh...
>
> Okay fredrik I know your idea won't work cos list only works with
> numericaly indexed arrays, both the arrays that i am using are indexed by
> date. (it produces a parse error when run)

Parse error simply means the code has a syntax error. Not necessarily that the 
idea doesn't work.

> Janet your idea i would have thought would work but i can't get it to,
> for some reason
>
> whenever I run the script it just gives me...
> "Warning:  Invalid argument supplied for foreach() in
> /home/filterseveuk/public_html/project/tips.php on line 56"
> Not sure as to what it is talking abotu here as far as I know, this should
> work.
>
> =
> foreach($tips as $key => $value){
>
> $pointvalue[$key] = $value / $staff[$key] ;
>
>  }

What does print_r($tips) give you? While you're at it do a var_dump($tips) as 
well.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Too cool to calypso,
Too tough to tango,
Too weird to watusi
-- The Only Ones
*/


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



[PHP-DB] Away on a trip

2003-03-09 Thread Nick . Hajek
I will be out of the office on the afternoon of Friday 3/7.   Please contact Ed 
Ortmeier or George Rayman for anything that can't wait until Monday.


Nick

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



Re: [PHP-DB] PHP to mysql to email

2003-03-09 Thread Jason Wong
On Monday 10 March 2003 10:44, JeRRy wrote:

> Now  is fetched from the name they give on the
> form.  So how would I send an email out automatically
> once they submit it?

mail()

> Also, but not really required yet but ideas
> appreciated, if the email BOUNCES is their a way to
> remove the entry that the email bounced email matches?

Search archives (php-general) for "mail bounce" or "mailing list bounce" or 
similar.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
No line available at 300 baud.
*/


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



Re: [PHP-DB] receiving date elements from Access

2003-03-09 Thread Jan Bro
oh, i've forgot to mention, I've already tried that, with the same result,
sorry my mistake. Even 12.12.2002 brings back the same result. It
doesn't make a difference if I use # or not.
But thx anayway, i'm sure it is some dumb mistake i made.
Jan


on 3/9/03 4:42 PM, Jan Bro at [EMAIL PROTECTED] appended the following bits to
my mbox:

> $datum_beginn="2002-12-12";
> $datensatz=odbc_exec($db_connection,"select * from Termin where
Datumsfeld>'#$datum_beginn#'");
>
> I get an error message that data in criteria doesn't match. (free
> translation)

> The field Datumsfeld is a date field with the syntax DD.MM. (German
way)

Maybe you should try the date in the syntax the database uses, i.e.,
12.12.2002?

Sincerely,

Paul Burney







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



[PHP-DB] Passing value in URL to Form

2003-03-09 Thread Stephen K Knight
I have managed to pass information through a URL and extract it and insert
it into a form on a php document.  Can this be done for an html document?
Passing the value through the URL to an html page with form and then through
a URL again into a php doc.  I tried the same method I used in the php doc
in the html doc but it didn't work.

Any ideas?

In kindness,
Stephen


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



[PHP-DB] PHP to mysql to email

2003-03-09 Thread JeRRy
Hi,

I have a PHP page that writes to a mysql database. 
Now I have got that bit to work well.  Now I want to
send out an email once a person submits the details. 
So on the database I grab fields like name, gender,
email etc...  Now I want to grab the email and send
out an email something like below once they submit
their details.

Dear ,

Thankyou for signing up, please visit...

Thanks!

Now  is fetched from the name they give on the
form.  So how would I send an email out automatically
once they submit it?

Also, but not really required yet but ideas
appreciated, if the email BOUNCES is their a way to
remove the entry that the email bounced email matches?
 I'd say this would be more complicated but any
suggestions are welcome on this.  I could always
manually remove them for the time being.

Jerry

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.

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



Re: [PHP-DB] receiving date elements from Access

2003-03-09 Thread Paul Burney
on 3/9/03 4:42 PM, Jan Bro at [EMAIL PROTECTED] appended the following bits to
my mbox:

> $datum_beginn="2002-12-12";
> $datensatz=odbc_exec($db_connection,"select * from Termin where
Datumsfeld>'#$datum_beginn#'");
> 
> I get an error message that data in criteria doesn't match. (free
> translation)

> The field Datumsfeld is a date field with the syntax DD.MM. (German way)

Maybe you should try the date in the syntax the database uses, i.e.,
12.12.2002?

Sincerely,

Paul Burney






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



RE: [PHP-DB] need to pass info in URL

2003-03-09 Thread Rich Hutchins
Usually, setting the method property to GET in your HTML form will do the
trick. It will cause all of the values in that particular form to be passed
along in the URL. It's a really basic HTML concept. Not sure if you're
looking for something else though since this is a PHP-DB mailing list?

-Original Message-
From: Stephen K Knight [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 09, 2003 8:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] need to pass info in URL


Is there a way to pass a value from on html page to another on a different
server through a URL and have that value input into a form.
The value trying to be passed is a record id from a database.

In Kindness
Stephen


--
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] need to pass info in URL

2003-03-09 Thread Stephen K Knight
Is there a way to pass a value from on html page to another on a different
server through a URL and have that value input into a form.
The value trying to be passed is a record id from a database.

In Kindness
Stephen


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



Re: [PHP-DB] need help with foreach()

2003-03-09 Thread Fredrik de Vibe
[EMAIL PROTECTED] (David Rice) writes:
> Hey thank's for the ideas but  neither of them work, doh...
> Okay fredrik I know your idea won't work cos list only works with
> numericaly indexed arrays, both the arrays that i am using are indexed
> by date.

You really had me wondering there for a moment. I've done this dozens
of times and list() does work with other than numerical values.

> (it produces a parse error when run)

Ok, I hadn't tested the code. For some reason you have to group $t /
$staff[$d] in parantheses, why I really don't know, it shouldn't be
necessary.

> =
> while(list($d, $t) = each($tips)){
   $res = ($t / $staff[$d]);
  ^   ^
>   // Do what you need with $res ...
> }
> =

The code below is tested and works.
---
$tips = array("foo" => "bar",
  "bar" => "foo");

$staff = array("foo" => "foobar",
   "bar" => "barfoo");

while(list($d, $t) = each($tips)){
  printf("%s - %s - %s\n", $d, $t, $staff[$d]);
}


-- 
--Fredrik
New systems generate new problems.

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



Re: [PHP-DB] need help with foreach()

2003-03-09 Thread David Rice
Hey thank's for the ideas but  neither of them work, doh...

Okay fredrik I know your idea won't work cos list only works with numericaly 
indexed arrays, both the arrays that i am using are indexed by date.
(it produces a parse error when run)
=
while(list($d, $t) = each($tips)){
  $res = $t / $staff[$d];
  // Do what you need with $res ...
}
=

Janet your idea i would have thought would work but i can't get it to, 
for some reason

whenever I run the script it just gives me...
"Warning:  Invalid argument supplied for foreach() in 
/home/filterseveuk/public_html/project/tips.php on line 56"
Not sure as to what it is talking abotu here as far as I know, this should 
work.

=
foreach($tips as $key => $value){
    $pointvalue[$key] = $value / $staff[$key] ;

 }

==

Does anyone else have a solution!?
Cheers,
Dave


In a message dated 3/9/2003 2:07:26 PM Pacific Standard Time, 
[EMAIL PROTECTED] writes:



Okay, i have two arrays, $tips and $staff

$tips has a key "date" (which is the date of the first day of the week, the
second result in the array has the key of the second day of the week etc...
) and the value is a floating point decimal.
$staff also has a key "date" and the value is an integer, the number of
staff working in one day.
To find out the ammount of tips every staff member is to get we have to
divide the value of $tips by the value of $staff (when the dates are the
same)
what i was trying  to get this to work is below,

any help would be great,
cheers
dave
=
foreach($tips as $key => $value){

    $pointvalue[$key] = $value / current($staff) ;

    next($staff);
    }


_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://messenger.msn.co.uk

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


[PHP-DB] Re: need help with foreach()

2003-03-09 Thread Fredrik de Vibe
[EMAIL PROTECTED] (David Rice) writes:
> Okay, i have two arrays, $tips and $staff
> 
> $tips has a key "date" (which is the date of the first day of the
> week, the second result in the array has the key of the second day of
> the week etc... ) and the value is a floating point decimal.
> 
> $staff also has a key "date" and the value is an integer, the number
> of staff working in one day.
> 
> To find out the ammount of tips every staff member is to get we have
> to divide the value of $tips by the value of $staff (when the dates
> are the same)

I guess

while(list($d, $t) = each($tips)){
  $res = $t / $staff[$d];
  // Do what you need with $res ...
}

would do the trick.


-- 
--Fredrik
"I cannot and will not cut my conscience to fit this year's fashions."
-- Lillian Hellman

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



[PHP-DB] need help with foreach()

2003-03-09 Thread David Rice
Okay, i have two arrays, $tips and $staff

$tips has a key "date" (which is the date of the first day of the week, the 
second result in the array has the key of the second day of the week etc... 
) and the value is a floating point decimal.

$staff also has a key "date" and the value is an integer, the number of 
staff working in one day.

To find out the ammount of tips every staff member is to get we have to 
divide the value of $tips by the value of $staff (when the dates are the 
same)

what i was trying  to get this to work is below,

any help would be great,
cheers
dave
=
foreach($tips as $key => $value){

		$pointvalue[$key] = $value / current($staff) ;

next($staff);
}
_
Express yourself with cool emoticons http://messenger.msn.co.uk
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] receiving date elements from Access

2003-03-09 Thread Jan Bro
Hi,
i've posted this in the general list, but I've got no answer. Well I'm still
hoping there is one ;-)

I've got the following code:

$datum_beginn="2002-12-12";
$datensatz=odbc_exec($db_connection,"select * from Termin where Datumsfeld
>'#$datum_beginn#'");

I get an error message that data in criteria doesn't match. (free
translation)

The error def. lays in Datumsfeld >'#$datum_beginn#'. How do I get a list of
all entries with a
date that lay behind a certain date? I'd prefer to let the database do the
job for me, rather than
pulling everything out and get the relevant data with php.

The field Datumsfeld is a date field with the syntax DD.MM. (German way)

thx
Jan




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



[PHP-DB] displaying multiple search results

2003-03-09 Thread Gerry Smith
Help please

I enclose my code examples of two pages.  One to gert search data from a
user which uis POSTed to the second page where it's validated and displayed.

The prev/next only works for the first 20 records.

When i click next, my page reloads and re applies my validation rules and
outputs the error messages to the user asking for valid input.

What am i doing wromng???

Thanks for any help




begin 666 myquery.txt
M/#\-"B\O+R\O+R\O+R\O+R\O+R\O+R\O+R\@("!004=%(#$@(" O+R\O+R\O
M+R\-"B\O(&1A=&[EMAIL PROTECTED]<[EMAIL PROTECTED];2XN+G!A9V4@;F%M92 B9&%T85]E;G1R
M>2YP:' B#0H-"B\O(&5X=')A8W0@;[EMAIL PROTECTED]&AE(&1A=&[EMAIL PROTECTED];2XN=&AE'1<(B!N86UE
M/5PBF4]7"(V-5PB(&UA>&QE;F=T:#U<(C4P7"(B.PT*
M"21F;W)M+CTB=F%L=64]7"(D'1<
M(B!N86UE/5PB9FER'1<(B!N86UE/5PB96UA:6Q<(B!S:7IE/5PB-C5<
M(B!M87AL96YG=&@]7"(W,%PB(CL-"@DD9F]R;2X](G9A;'5E/5PB)&5M86EL
M7"(^(CL-"@DD9F]R;2X](CQB&%M<&QE(&]F(&]N;'D@,R!F:65L9',N
M("!);B!R96%L:71Y('1H97)E(&%R92!M;W)E(&9I96QD2!F:65L9',N(" \<#Y9;[EMAIL PROTECTED]('-E87)C:"!B>2!%
M+4UA:[EMAIL PROTECTED]:&]U="!E;G1E2!P;&%C:6YG('1H92 J
M(&-H87)A8W1ER ):68@"[EMAIL 
PROTECTED])&9I2!A9&1S('1O('1H92!Q=65R>2!S=')I;F'0@/2 B3F5X
M="([( T*#0H@(" @(" @(" @(" D;G5M7-Q;%]Q=65R>[EMAIL PROTECTED]
M<75E[EMAIL PROTECTED];V9FR -
M"B @(" @(" @(" @("1O9F9S970],[EMAIL PROTECTED]@(" @(" @(" @("!]( T*#0H-
M"B @(" @(" @(" @(&5C:&\@(CQT86)L92!W:61T:#TQ,# E(&)G8V]L;W(]
M(T9&1D9&1B!B;W)D97(],"!C96QL<&%D9&EN9STR( T*(" @(" @(" @(" @
M8V5L;'-P86-I;F<],CXB.R -"@D)"21S<6P@/2 D<75E[EMAIL PROTECTED]@(" @(" @(" @("!W:&EL92 H
M)')O=R ](&UYR -"B @(" @(" @(" @
M("1PR -"B @(" @
M(" @(" @("1N97AT;V9F2!T;R!D;R!T:&ES+"[EMAIL PROTECTED](&]N;'[EMAIL PROTECTED];B!F86-E
M9"!W:71H(&1I"!T
M:&EN9W,@=&AE('=A>2!)(&[EMAIL PROTECTED]&]N92!T:&5M/PT*#0I)9B!N;W0L(&-A
M;B!A;GEO;F4@2!I='-E;&8N("!/=&AE2!S='5C
M:RX@($D@:&%V92!B;W5G:'0@,R!B;V]K2!C;V1I;Fhttp://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] How can I divide the loop result into 2 columns???

2003-03-09 Thread Shavkat
> I have a page to show all the category fields, so I've made it, but I want
> the results to be divided into several columns, Please help me if
possible.
>
> Regards Shavkat Berdiev.



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



[PHP-DB] How can I divide the loop result into 2 columns???

2003-03-09 Thread Shavkat
I have a page to show all the category fields, so I've made it, but I want
the results to be divided into several columns, Please help me if possible.

Regards Shavkat Berdiev.





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



[PHP-DB] How can I divide the loop result into 2 columns???

2003-03-09 Thread Shavkat
I have a page to show all the category fields, so I've made it, but I want
the results to be divided into several columns, Please help me if possible.

Regards Shavkat Berdiev.



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



[PHP-DB] Multidimensional arrays / Dynamic variables

2003-03-09 Thread David Rice
Okay the problem is adding another result to the multi-dimensional array

When i perform var_dump on the returned varialbe $tips i get

array(1) {   [2]=>   array(1) { [0]=> string(10) "2003-03-07"   } }

I know that there are 2 results missing here for when the key of the array 
is 1 ($staffid = 1)
the results are such that the array should look like this

array(1) { [1]=>   array(2) { [0]=> string(10) "2003-03-06"
 [1]=> string(10) 
"2003-03-07"   }
  [2]=>   array(1) { [0]=> string(10) "2003-03-07"  
 }
}

now I just need some help getting my code to produce the second output.
=

function tips($weekstart){
	$start = date('Ymd',strtotime($weekstart));
	$query = "SELECT * FROM Rota WHERE date >= $start and date <= ($start + 
INTERVAL 6 DAY) ORDER BY staffid";
	$result = mysql_query($query);

_
Overloaded with spam? With MSN 8, you can filter it out 
http://join.msn.com/?page=features/junkmail&pgmarket=en-gb&XAPID=32&DI=1059

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


[PHP-DB] Problem connecting with PostgreSQL in OS X

2003-03-09 Thread Eric Marsh
Good Morning,

I've got a J2EE program I've been working on for some time that has 
been connected to a FrontBase DBMS. Well as a result of my spending 
some time exploring the open source world I've decided to to change 
database to PostgreSQL.

I'm developing on Mac OS X and found a page on the Apple website 
describing how to set up PostgreSQL and then how to connect to it. I 
built and installed PostgreSQL and performed a couple simple operations 
to confirm that its working properly.

Next, to simplify administration I followed the instructions to install 
PHP and phpPgAdmin. Using the simple example script I was able to 
connect to the database with PHP. When I tried to use phpPgAdmin I was 
getting fail to login errors. Poking around the PHP code I discovered 
that if I commented out a line that added "host=localhost"  I was able 
to connect.

Does anyone have any idea why host=localhost is breaking my connection? 
Is there a configuration value I should be setting?

Thanks,

Eric Marsh

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


[PHP-DB] Re: Dynamic Variable names

2003-03-09 Thread Adam Royle
It's probably better to use arrays.

$tips[0] = "value";
$tips[1] = "value";
$tips[2] = "value";
Although, if you REALLY want dynamic variable names.

$i = 1;
$varname = 'tips_'.$i;
$$varname = "value";
this will make a variable like below:

$tips_1 = "value";

But like I said before, it's better to use arrays - they are much more 
flexible (and PHP arrays are especially cool).

http://www.php.net/manual/en/ref.array.php

adam

Just a quick question about dynamic variables

would like to end up with a variable called
$tips_1
$tips_2
...
$tips_n
where "n" is the value of the variable $sid

i have tried

$tips . '$sid';

and other variants, but i can't get one that doesn't return a parse 
error or T_VARIABLE error.


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


[PHP-DB] Dynamic Variable names

2003-03-09 Thread David Rice




Just a quick question about dynamic variables

would like to end up with a variable called
$tips_1
$tips_2
...
$tips_n
where "n" is the value of the variable $sid

i have tried

$tips . '$sid';

and other variants, but i can't get one that doesn't return a parse error or 
T_VARIABLE error.

_
Worried what your kids see online? Protect them better with MSN 8 
http://join.msn.com/?page=features/parental&pgmarket=en-gb&XAPID=186&DI=1059

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