[PHP-DB] php.exe Application Error

2002-11-12 Thread Radovan Radic
Hi all,

I have tried this in php.windows, no answers there and since this is kind of
db question i will try here.

IIS Win2000, MSSQL 7, PHP 4.2.3

I have script that reads about 100-200 rows in the SELECT list and it is ok.
After that, i have robust sql query for select some data from 4-5 tables, so
i have to use joins. It returns about 600 rows (in the SQL Query Analyzer it
works) - but in php i get this error:

The instruction at 0x77fcb007 referenced memory at '0x000.
The memory could not be written.
Click on OK to terminate the program
Click on CANCEL to debug the program

Does anyone know what this could be?
On the other server, which has php 4.0.6 this script works without
problems!?
Also, when i have where clause in the query, which reduces number of
retreived rows, mssql_query will work.

Thanks in advance,
Radovan



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




[PHP-DB] Re: php.exe Application Error

2002-11-12 Thread Radovan Radic

Radovan Radic [EMAIL PROTECTED] wrote in message
news:20021112093111.53801.qmail;pb1.pair.com...
 Hi all,

 I have tried this in php.windows, no answers there and since this is kind
of
 db question i will try here.

 IIS Win2000, MSSQL 7, PHP 4.2.3

 I have script that reads about 100-200 rows in the SELECT list and it is
ok.
...

Hi, answering to myself.
After browsing on http://bugs.php.net i have found that i need to convert
smallmoney fields cast(tbl.field_name as decimal(9,2)) and it worked.

Radovan



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




[PHP-DB] Re: [PHP-WIN] update tablename

2002-11-12 Thread Ignatius Reilly
You can not do it directly.

You have to create a new table as a copy of the old one:

CREATE TABLE new_table
SELECT * FROM old_table

Your problem will be that the MySQL PHP user will probably not have the
CREATE rights.

Ignatius

Rodrigo San Martin [EMAIL PROTECTED] wrote in message
news:20021112113152.9310.qmail;pb1.pair.com...
 Hi.
 I want to change a tablename in my database. How do i do that? I want to
do
 it from a webpage so i need to use php.





 --
 Rodrigo San Martin
 Institutt for datateknologi og informatikk

 http://www.idi.ntnu.no/~rodrigo




 --
 PHP Windows 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] Access a Flat File DB - How?

2002-11-12 Thread Maxim Maletsky

Risks are to share properly the data. You can never rely on the accuracy
of data in the flat files as those could be changing at the same
instance as your application is reading it. RDMS (not mySQL) can handle
it under relational logic mechanisms, meaning they would not read the
data that is currently being written and would not write the data that
is currently being read.


--
Maxim Maletsky
[EMAIL PROTECTED]



Crony [EMAIL PROTECTED] wrote... :

 I have written a few small apps in PHP and MySQL. These were mostly copy,
 paste and change and fairly easy. I now wnat ot connect to a flat file dbase
 that is used by another enterprise app. Then I want to start normal PHP
 programming. Is there any risk in doing this? Where do I start?
 
 
 
 
 -- 
 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] array sorting

2002-11-12 Thread Martin Allan Jensen
Hi everyone...


I got a bit longer now..

But i have some trouble sorting my arrays

I get this array returned.

Array ( [0] = Array ( [0] = 10 [1] = 40 [2] = 50 [3] = 80 [4] = 130 [5] = 220 
[6] = 320 ) [1] = Array ( [0] = 10 [1] = 40 [2] = 50 [3] = 80 [4] = 130 [5] = 
220 [6] = 320 [7] = 440 [8] = 570 ) [2] = ) 

I ain't good at it, but i guess this is a two dimesioned array...

The question is now,  i need to get the highest values of each sub array witch would 
be 320  570 in THIS CASE ??

Thanks so much!!

Martin Allan Jensen


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




Re: [PHP-DB] array sorting

2002-11-12 Thread Ignatius Reilly
Just loop through the first index, then search on the second index:

while ( list( $key, $value ) = each( $my_arr ) ) {

// now $value is your ( [0] = 10 [1] = 40 [2] = 50 [3] = 80 [4] =
130 [5] = 220 [6] = 320 ) array
// sort your array by values
sort( $value ) ;
// get the last value
$last_value = array_pop( $value ) ;
// do something with this value...

}

But it seems to me there still misses a link between your two series of data
(years, values)

So try to get an array where keys are years, not numerical indexes?

HTH
Ignatius

- Original Message -
From: Martin Allan Jensen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 12, 2002 1:37 PM
Subject: [PHP-DB] array sorting


Hi everyone...


I got a bit longer now..

But i have some trouble sorting my arrays

I get this array returned.

Array ( [0] = Array ( [0] = 10 [1] = 40 [2] = 50 [3] = 80 [4] = 130
[5] = 220 [6] = 320 ) [1] = Array ( [0] = 10 [1] = 40 [2] = 50 [3] =
80 [4] = 130 [5] = 220 [6] = 320 [7] = 440 [8] = 570 ) [2] = )

I ain't good at it, but i guess this is a two dimesioned array...

The question is now,  i need to get the highest values of each sub array
witch would be 320  570 in THIS CASE ??

Thanks so much!!

Martin Allan Jensen


--
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] session in php 4.2.3

2002-11-12 Thread dn
Hi!

I have to support a PHP-Database-solution which someone else
has developed. In addition I'm quite new to php ...

It uses Oracle 8 to display values out of the database.
Everything is running fine with php 4.1.1.
Due to security reasons I wanted to update to php 4.2.3.
I use the same values within both configure-runs:

./configure \
	--with-oci8=/oracle/product/8.1.7 \
	--with-apxs=/usr/sbin/apxs \
	--enable-sigchild \
	--with-zlib-dir=shared \
	--with-gd=/usr/ \
	--with-png-dir=/usr/lib \
	--without-mysql

The php-scripts do the following when a user logs in:

   session_register(user,password,db);

I assume that other scripts can use this values when they
query the database. A session-file is created in /tmp/.
As I mentioned above everything runs fine with php 4.1.1.

With php 4.2.3 the login-script is ok! When another script
is called it seems like it is not able to read the sess-file
which exists (!) in /tmp/sess

Could you please give me a hint what I'm doing wrong!

Thanks in advance!

Daniel


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




Re: [PHP-DB] session in php 4.2.3

2002-11-12 Thread Jeffrey_N_Dyke

are you stating the session on on the other pages with session_start()?
what errors are you getting?  if you check for session_is_registered
(user) on the other pages, what do you get?

can you send some code along, its hard to see what the issue may be without
it.




   
  
dn 
  
dn75@planet-in   To: [EMAIL PROTECTED] 
  
terkom.decc:  
  
  Subject: [PHP-DB] session in php 4.2.3   
  
11/12/2002 
  
07:54 AM   
  
   
  
   
  




Hi!

I have to support a PHP-Database-solution which someone else
has developed. In addition I'm quite new to php ...

It uses Oracle 8 to display values out of the database.
Everything is running fine with php 4.1.1.
Due to security reasons I wanted to update to php 4.2.3.
I use the same values within both configure-runs:

./configure \
 --with-oci8=/oracle/product/8.1.7 \
 --with-apxs=/usr/sbin/apxs \
 --enable-sigchild \
 --with-zlib-dir=shared \
 --with-gd=/usr/ \
 --with-png-dir=/usr/lib \
 --without-mysql

The php-scripts do the following when a user logs in:

   session_register(user,password,db);

I assume that other scripts can use this values when they
query the database. A session-file is created in /tmp/.
As I mentioned above everything runs fine with php 4.1.1.

With php 4.2.3 the login-script is ok! When another script
is called it seems like it is not able to read the sess-file
which exists (!) in /tmp/sess

Could you please give me a hint what I'm doing wrong!

Thanks in advance!

Daniel


--
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] session in php 4.2.3

2002-11-12 Thread dn
Hi!

Jeffrey N Dyke schrieb:

are you stating the session on on the other pages with session_start()?


Yes I do! Code comes along!
anmelden.php does a successful db-login (db-logfile confirms that).
content.php runs into:

Warning: OCISessionBegin: ORA-01017: invalid username/password; logon 
denied in /usr/local/httpd/htdocs/funktionen.php on line 6


register_globals is turned on in my php.ini!

thanks
Daniel
?
  session_start();
  session_set_cookie_params(0);
  require_once(funktionen.php);
  $text=nbsp;;

  if (isset($HTTP_POST_VARS[submit]))
 {

session_register(user,password,db);
$user = $HTTP_POST_VARS[form_user];
$password = $HTTP_POST_VARS[form_password];
$db = $HTTP_POST_VARS[form_db];
if (OCILogon($user,$password,$db) != false)
{
$sessid = session_id();
$conn0 = OCILogon($user, $password, $db);
$query0 = begin kanban_owner.php_init_benutzer('$user','$sessid'); 
end;;
$cursor0 = OCIParse($conn0, $query0) or die (Fehler beim Parsen);

// Commit, hier werden die Jobs ausgefuuml;hrt.
OCIExecute($cursor0) or die (Fehler beim Ausfuuml;hren);
OCIFreeStatement($cursor0);
del_graphs();
header(Location: index.php);
exit;
}
$text=font color=redbUsername/Password falsch!/b/font;
 }
  else
  if ($abmelden == 1)
  {   //echo Abmelden! ;
  $sessid = session_id();
  if (OCILogon($user,$password,$db) != false)
  {
  $conn = OCILogon($user, $password, $db);
  $query1 = begin sys.php_unregister_session('$user','$sessid'); end;;
  $cursor1 = OCIParse($conn, $query1) or die (Fehler beim Parsen);
  OCIExecute($cursor1);
//  OCIFreeStatement($cursor1);
}
  session_destroy();
  $abmelden = 0;
  header(Location: anmelden.php);

  }

?
html
head
titleAnmelde Formular/title
/head
body text=#ff
form method=post action=? echo $PHP_SELF ?
table width=100% height=80%
trtd align=center valign=middle
table bgcolor=#1C2B74 border=0 cellspacing=0 cellpadding=0
tr
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
/tr
   tr border=1 align=center
   tdnbsp;/td
   tdnbsp;/td
   tdnbsp;/td
   td? print($text); ?/td
   tdnbsp;/td
/tr
tr
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
/tr

tr
tdnbsp;/td
tdbBenutzername:/td
tdnbsp;/td
tdinput type=text size=20 name=form_user value=/td
tdnbsp;/td
/tr

tr
td width=10nbsp;/td
tdbPasswort:/td
td width=30nbsp;/td
tdinput type=password size=20 name=form_password value=/td
td width=50nbsp;/td
/tr

tr
tdnbsp;/td
tdbHost/DB-Name:/td
tdnbsp;/td
tdinput type=text size=20 name=form_db value=/td
tdnbsp;/td
/tr

trtdnbsp;/tdtdnbsp;/tdtdnbsp;/tdtdnbsp;/tdtdnbsp;/td/tr
tr
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
td align=rightinput type=submit name=submit value=Anmelden/td
tdnbsp;/td
/tr

trtdnbsp;/tdtdnbsp;/tdtdnbsp;/tdtdnbsp;/tdtdnbsp;/td/tr

trtdnbsp;/tdtdnbsp;/tdtdnbsp;/tdtdnbsp;/tdtdnbsp;/td/tr

/table
/td/tr/table
/form
/body
/html


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


Re: [PHP-DB] session in php 4.2.3

2002-11-12 Thread Leif K-Brooks
My guess is a register_globals problem, but it's hard to tell without 
seeing your scripts.

dn wrote:

Hi!

I have to support a PHP-Database-solution which someone else
has developed. In addition I'm quite new to php ...

It uses Oracle 8 to display values out of the database.
Everything is running fine with php 4.1.1.
Due to security reasons I wanted to update to php 4.2.3.
I use the same values within both configure-runs:

./configure \
--with-oci8=/oracle/product/8.1.7 \
--with-apxs=/usr/sbin/apxs \
--enable-sigchild \
--with-zlib-dir=shared \
--with-gd=/usr/ \
--with-png-dir=/usr/lib \
--without-mysql

The php-scripts do the following when a user logs in:

   session_register(user,password,db);

I assume that other scripts can use this values when they
query the database. A session-file is created in /tmp/.
As I mentioned above everything runs fine with php 4.1.1.

With php 4.2.3 the login-script is ok! When another script
is called it seems like it is not able to read the sess-file
which exists (!) in /tmp/sess

Could you please give me a hint what I'm doing wrong!

Thanks in advance!

Daniel




--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.




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




[PHP-DB] date questions in mySql

2002-11-12 Thread Paul Ihrig
ok i can parse a date from mySql date field 
so it displays as: 08/06/1972
but if i insert it into the field in this format
then the date gets hosed.

do i have to insert as -mm-dd
can i have a form field that has mm/dd/
but then change it on insert?
how would i do this?

thanks.
-paul 

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




Re: [PHP-DB] date questions in mySql

2002-11-12 Thread Jeffrey_N_Dyke

check out the date( ) function in mysql.  a quick prelude of it
is.select date(date_col, %m/%d/%Y)  from table...this will take
-mm-dd and return mm/dd/




   
 
Paul Ihrig   
 
pihrig@columb   To: [EMAIL PROTECTED]
 
us.rr.com   cc:   
 
 Subject: [PHP-DB] date questions in mySql 
 
11/12/2002 
 
09:26 AM   
 
   
 
   
 




ok i can parse a date from mySql date field
so it displays as: 08/06/1972
but if i insert it into the field in this format
then the date gets hosed.

do i have to insert as -mm-dd
can i have a form field that has mm/dd/
but then change it on insert?
how would i do this?

thanks.
-paul

--
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] Dynamic MySql Update Query

2002-11-12 Thread David Rice
Okay this is a tough one.
I want to make a dynamic mysql update query that takes results entered into 
a series of text boxes (changes from page to page) and then updates that 
record in my Mysql table.

the name of the form fields are $value[$x]
where 1 = $x = Total number of fields

===

$query = UPDATE .$table. WHERE .$table_headers[0]. = .$id.
	VALUES

===
I have gotten this far, but don't know where to go next.
check out www.filterseven.co.uk/admin/index.php
and if you check a table, and choose an edit query on one of the records to 
see what i am trying to do.

thank's for your time!
cheers,
David Rice



_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



[PHP-DB] sql select

2002-11-12 Thread Steve Dodkins
if i have a statement 

$result = mysql_query(SELECT
labor_id,labor_ord_no,labor_wkyr,works_orders_part_no,works_orders_qty,works
_orders_customer_id,labor_qty,labor_time,labor_qty*parts_time+parts_setup AS
timea FROM labor,works_orders,parts WHERE labor_ord_no=works_orders_ord_no
AND works_orders_part_no=parts_no AND time2 = labor_wkyr ORDER BY
labor_wkyr,works_orders_ord_no,$link); 

This works fine but if i add AND timea  labor_time it fails 



Regards

Steve Dodkins

IMPORTANT NOTICE The information in this e-mail is confidential and should
only be read by those persons to whom it is addressed and is not intended to
be relied upon by any person without subsequent written confirmation of its
contents. ebm-ZIEHL (UK) Ltd. cannot accept any responsibility for the
accuracy or completeness of this message as it has been transmitted over a
public network.   Furthermore, the content of this e-mail is the personal
view of the sender and does not represent the advice, views or opinion of
our company. Accordingly, our company disclaim all responsibility and accept
no liability (including in negligence) for the consequences of any person
acting, or refraining from acting, on such information prior to the receipt
by those persons of subsequent written confirmation. In particular (but not
by way of limitation) our company disclaims all responsibility and accepts
no liability for any e-mails which are defamatory, offensive, racist or in
any other way are in breach of any third party's rights, including breach of
confidence, privacy or other rights. If you have received this e-mail
message in error, please notify me immediately by telephone. Please also
destroy and delete the message from your computer. Any form of reproduction,
dissemination, copying, disclosure, modification, distribution and/or
publication of this e-mail message is strictly prohibited.  If you have
received this E-mail in error, or suspect that the message may have been
intercepted or amended, please notify ebm-ZIEHL (UK) Ltd on +44(0)1245
468555.
ebm-ZIEHL (UK) Ltd Chelmsford Business Park, Chelmsford, Essex CM2 5EZ




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




Re: [PHP-DB] session in php 4.2.3

2002-11-12 Thread dn
Hi!

Leif K-Brooks schrieb:

My guess is a register_globals problem, but it's hard to tell without 
seeing your scripts.


That did the trick! Thank you very much!
I did not provide a path to php.ini so
the setting was first not read!
Now it works!

Best regards
Daniel



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




RE: [PHP-DB] sql select

2002-11-12 Thread Edward Peloke
I don't think you can reference the aliased column timea in the select
clause, I know sql server won't let you do it..try and

(labor_qty*parts_time+parts_setup)labor_time
-Original Message-
From: Steve Dodkins [mailto:Steve.Dodkins;ebm-ziehl.co.uk]
Sent: Tuesday, November 12, 2002 10:16 AM
To: Php-Db (E-mail)
Subject: [PHP-DB] sql select


if i have a statement

$result = mysql_query(SELECT
labor_id,labor_ord_no,labor_wkyr,works_orders_part_no,works_orders_qty,works
_orders_customer_id,labor_qty,labor_time,labor_qty*parts_time+parts_setup AS
timea FROM labor,works_orders,parts WHERE labor_ord_no=works_orders_ord_no
AND works_orders_part_no=parts_no AND time2 = labor_wkyr ORDER BY
labor_wkyr,works_orders_ord_no,$link);

This works fine but if i add AND timea  labor_time it fails



Regards

Steve Dodkins

IMPORTANT NOTICE The information in this e-mail is confidential and should
only be read by those persons to whom it is addressed and is not intended to
be relied upon by any person without subsequent written confirmation of its
contents. ebm-ZIEHL (UK) Ltd. cannot accept any responsibility for the
accuracy or completeness of this message as it has been transmitted over a
public network.   Furthermore, the content of this e-mail is the personal
view of the sender and does not represent the advice, views or opinion of
our company. Accordingly, our company disclaim all responsibility and accept
no liability (including in negligence) for the consequences of any person
acting, or refraining from acting, on such information prior to the receipt
by those persons of subsequent written confirmation. In particular (but not
by way of limitation) our company disclaims all responsibility and accepts
no liability for any e-mails which are defamatory, offensive, racist or in
any other way are in breach of any third party's rights, including breach of
confidence, privacy or other rights. If you have received this e-mail
message in error, please notify me immediately by telephone. Please also
destroy and delete the message from your computer. Any form of reproduction,
dissemination, copying, disclosure, modification, distribution and/or
publication of this e-mail message is strictly prohibited.  If you have
received this E-mail in error, or suspect that the message may have been
intercepted or amended, please notify ebm-ZIEHL (UK) Ltd on +44(0)1245
468555.
ebm-ZIEHL (UK) Ltd Chelmsford Business Park, Chelmsford, Essex CM2 5EZ




--
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] sql select

2002-11-12 Thread Adam Williams
Have you ran it by hand in MySQL from the command prompt with some test
data and gotten an error?

Adam

On Tue, 12 Nov 2002, Steve Dodkins wrote:

 if i have a statement

 $result = mysql_query(SELECT
 labor_id,labor_ord_no,labor_wkyr,works_orders_part_no,works_orders_qty,works
 _orders_customer_id,labor_qty,labor_time,labor_qty*parts_time+parts_setup AS
 timea FROM labor,works_orders,parts WHERE labor_ord_no=works_orders_ord_no
 AND works_orders_part_no=parts_no AND time2 = labor_wkyr ORDER BY
 labor_wkyr,works_orders_ord_no,$link);

 This works fine but if i add AND timea  labor_time it fails



 Regards

 Steve Dodkins

 IMPORTANT NOTICE The information in this e-mail is confidential and should
 only be read by those persons to whom it is addressed and is not intended to
 be relied upon by any person without subsequent written confirmation of its
 contents. ebm-ZIEHL (UK) Ltd. cannot accept any responsibility for the
 accuracy or completeness of this message as it has been transmitted over a
 public network.   Furthermore, the content of this e-mail is the personal
 view of the sender and does not represent the advice, views or opinion of
 our company. Accordingly, our company disclaim all responsibility and accept
 no liability (including in negligence) for the consequences of any person
 acting, or refraining from acting, on such information prior to the receipt
 by those persons of subsequent written confirmation. In particular (but not
 by way of limitation) our company disclaims all responsibility and accepts
 no liability for any e-mails which are defamatory, offensive, racist or in
 any other way are in breach of any third party's rights, including breach of
 confidence, privacy or other rights. If you have received this e-mail
 message in error, please notify me immediately by telephone. Please also
 destroy and delete the message from your computer. Any form of reproduction,
 dissemination, copying, disclosure, modification, distribution and/or
 publication of this e-mail message is strictly prohibited.  If you have
 received this E-mail in error, or suspect that the message may have been
 intercepted or amended, please notify ebm-ZIEHL (UK) Ltd on +44(0)1245
 468555.
 ebm-ZIEHL (UK) Ltd Chelmsford Business Park, Chelmsford, Essex CM2 5EZ







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




[PHP-DB] Passing multiple form variable in PHP

2002-11-12 Thread Stephen Rhodes
HELLO - this is probably a simple problem !!

Wanting to use select multiple ...  in a html form and pass multiple value
into a php variable but does
not work. I only get a single value. Can you tell me what I am doing wrong
?

Does the multiple value get passed correctly in php 

if ($task==check)
{
 printf($icon);
}
else
{
 print 'form name=sqlform method=post action=test.php?task=check
 font class=look2Multiple Check:/font
select multiple name=icon
 option value=falseFalse/option
 option value=trueTrue/option
   /selectbrbr
   input type=submit name=submit value=Submit border=0/form';
}

Thanks
Steve R



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




RE: [PHP-DB] Passing multiple form variable in PHP

2002-11-12 Thread Ford, Mike [LSS]
 -Original Message-
 From: Stephen Rhodes [mailto:stephen.rhodes;scils.co.uk]
 Sent: 12 November 2002 16:32
 
 Wanting to use select multiple ...  in a html form and pass 
 multiple value
 into a php variable but does
 not work. I only get a single value. Can you tell me what I 
 am doing wrong
 ?

You're not telling PHP to expect multiple values -- this is done by putting array 
brackets [] on the end of the field name.

 
 Does the multiple value get passed correctly in php 

Yes.

 select multiple name=icon

Needs to be:

  select multiple name=icon[]

and $_POST['icon'] will be an array of the selected values.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP-DB] Passing multiple form variable in PHP

2002-11-12 Thread Jeffrey_N_Dyke

using the [] makes your variable an array when it comes into php.
 **snip**
 else
{
 print 'form name=sqlform method=post action=test.php?task=check
 font class=look2Multiple Check:/font
   select multiple name=icon[]
option value=falseFalse/option
option value=trueTrue/option
   /selectbrbr
   input type=submit name=submit value=Submit border=0/form';
}
**snip**



   
 
Stephen Rhodes   
 
stephen.rhodes@sc   To: [EMAIL PROTECTED]  
 
ils.co.uk   cc:   
 
 Subject: [PHP-DB] Passing multiple 
form variable in PHP
11/12/2002 11:31   
 
AM 
 
   
 
   
 




HELLO - this is probably a simple problem !!

Wanting to use select multiple ...  in a html form and pass multiple
value
into a php variable but does
not work. I only get a single value. Can you tell me what I am doing wrong
?

Does the multiple value get passed correctly in php 

if ($task==check)
{
 printf($icon);
}
else
{
 print 'form name=sqlform method=post action=test.php?task=check
 font class=look2Multiple Check:/font
   select multiple name=icon
option value=falseFalse/option
option value=trueTrue/option
   /selectbrbr
   input type=submit name=submit value=Submit border=0/form';
}

Thanks
Steve R



--
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: Passing multiple form variable in PHP

2002-11-12 Thread Stephen Rhodes
Cheers - query Answered


Stephen Rhodes [EMAIL PROTECTED] wrote in message
news:20021112162930.65021.qmail;pb1.pair.com...
 HELLO - this is probably a simple problem !!

 Wanting to use select multiple ...  in a html form and pass multiple
value
 into a php variable but does
 not work. I only get a single value. Can you tell me what I am doing wrong
 ?

 Does the multiple value get passed correctly in php 

 if ($task==check)
 {
  printf($icon);
 }
 else
 {
  print 'form name=sqlform method=post action=test.php?task=check
  font class=look2Multiple Check:/font
 select multiple name=icon
  option value=falseFalse/option
  option value=trueTrue/option
/selectbrbr
input type=submit name=submit value=Submit border=0/form';
 }

 Thanks
 Steve R





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




[PHP-DB] SQLyog 2.51 - the definitve FREE Windows front-end to MySQL

2002-11-12 Thread Karam Chand
Greetings

SQLyog v2.51. The definitive Windows Front End for
MySQL. SQLyog is FREE!

Some of the new features added in SQLyog 2.51 are - 

-- Alter Table structure in an easy to use Grid mode.
-- Optimized for speed and network resources.
-- Insert / Update data in a table.
-- Insert / Update BLOB data. All popular formats
supported (BMP/PNG/GIF/JPG).
-- Save your BLOB data in a file.
-- Very fast client side sorting / filtering.
-- Create / Edit Users.
-- Manage permissions for Database / Table / Column.
-- View information for Database / Table.
-- Export database schema in HTML.
-- Execute very large ( size limited by OS ) SQL batch
files.
-- Export data in Fixed Width format.
-- View all queries executed in history log.
-- Various operations on tables.
-- Backup / Restore databases and tables.
-- Improved Export functionality.
-- Improved Import functionality.
-- Improved SQL Editor.
-- Show / Hide Result Pane.
-- Lot of bug fixes.
-- And many more...

You can download the new SQLyog at
http://www.webyog.com/sqlyog/download.html

Thanks for your attention.

Rgds
Karam


__
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

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




RE: [PHP-DB] sql select

2002-11-12 Thread Steve Dodkins
Top man!!

Many thanks

Steve

-Original Message-
From: [EMAIL PROTECTED] [mailto:epeloke;echoman.com]
Sent: 12 November 2002 16:02
To: Php-Db (E-mail)
Subject: RE: [PHP-DB] sql select


I don't think you can reference the aliased column timea in the select
clause, I know sql server won't let you do it..try and

(labor_qty*parts_time+parts_setup)labor_time
-Original Message-
From: Steve Dodkins [mailto:Steve.Dodkins;ebm-ziehl.co.uk]
Sent: Tuesday, November 12, 2002 10:16 AM
To: Php-Db (E-mail)
Subject: [PHP-DB] sql select


if i have a statement

$result = mysql_query(SELECT
labor_id,labor_ord_no,labor_wkyr,works_orders_part_no,works_orders_qty,works
_orders_customer_id,labor_qty,labor_time,labor_qty*parts_time+parts_setup AS
timea FROM labor,works_orders,parts WHERE labor_ord_no=works_orders_ord_no
AND works_orders_part_no=parts_no AND time2 = labor_wkyr ORDER BY
labor_wkyr,works_orders_ord_no,$link);

This works fine but if i add AND timea  labor_time it fails



Regards

Steve Dodkins

IMPORTANT NOTICE The information in this e-mail is confidential and should
only be read by those persons to whom it is addressed and is not intended to
be relied upon by any person without subsequent written confirmation of its
contents. ebm-ZIEHL (UK) Ltd. cannot accept any responsibility for the
accuracy or completeness of this message as it has been transmitted over a
public network.   Furthermore, the content of this e-mail is the personal
view of the sender and does not represent the advice, views or opinion of
our company. Accordingly, our company disclaim all responsibility and accept
no liability (including in negligence) for the consequences of any person
acting, or refraining from acting, on such information prior to the receipt
by those persons of subsequent written confirmation. In particular (but not
by way of limitation) our company disclaims all responsibility and accepts
no liability for any e-mails which are defamatory, offensive, racist or in
any other way are in breach of any third party's rights, including breach of
confidence, privacy or other rights. If you have received this e-mail
message in error, please notify me immediately by telephone. Please also
destroy and delete the message from your computer. Any form of reproduction,
dissemination, copying, disclosure, modification, distribution and/or
publication of this e-mail message is strictly prohibited.  If you have
received this E-mail in error, or suspect that the message may have been
intercepted or amended, please notify ebm-ZIEHL (UK) Ltd on +44(0)1245
468555.
ebm-ZIEHL (UK) Ltd Chelmsford Business Park, Chelmsford, Essex CM2 5EZ




--
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] payperiods

2002-11-12 Thread Darren Bentley
Hello,

I have build a php calendar and want to implement 2 week payperiods so
staff can enter their hours worked. Then I can summarize work done per
pay period.

Any idea what the easiest way to do this is? I could hard code a
starting date into a database, then go up 2 weeks at a time from there.
Is there a better way?

Thanks,

-- 
Darren Bentley / Systems Administrator
Borealis Internet / 1-800-667-0307
Prince George, BC, Canada
http://www.pgweb.com


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




Re: [PHP-DB] payperiods

2002-11-12 Thread Peter Beckman
$nextpayperiod = mktime(0,0,0,$month,$day+14,$year);
$humanreadabledate = date(r,$nextpayperiod);

where $month is numeric month, $day is the last payperiod day (1-31), and
$year is the year of the payperiod.

$nextpayperiod will equal the unix timestamp of 14 days from the last payperiod.

Peter

On 12 Nov 2002, Darren Bentley wrote:

 Hello,

 I have build a php calendar and want to implement 2 week payperiods so
 staff can enter their hours worked. Then I can summarize work done per
 pay period.

 Any idea what the easiest way to do this is? I could hard code a
 starting date into a database, then go up 2 weeks at a time from there.
 Is there a better way?

 Thanks,

 --
 Darren Bentley / Systems Administrator
 Borealis Internet / 1-800-667-0307
 Prince George, BC, Canada
 http://www.pgweb.com


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


---
Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation
[EMAIL PROTECTED] http://www.purplecow.com/
---


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




RE: [PHP-DB] payperiods

2002-11-12 Thread Anderson, Jerrad
I would think that the hard coded date is the way I'd do that.

maybe not neccessarily a start_dt, but maybe a pay_pd_st date. This date is just the 
date the payperiod falls on. You increment it once every two weeks. Have a table in 
your db with that field and variable. maybe hardcode the very first date. and a pay 
period date. 

if on linux or unix you can run a cron job to increment that date, or do some 
calculation to the hardcoded date when displaying a calendar.

hmm... i'm rambling..

-Original Message-
From: Darren Bentley [mailto:darren;bcgroup.net]
Sent: Tuesday, November 12, 2002 1:51 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] payperiods


Hello,

I have build a php calendar and want to implement 2 week payperiods so
staff can enter their hours worked. Then I can summarize work done per
pay period.

Any idea what the easiest way to do this is? I could hard code a
starting date into a database, then go up 2 weeks at a time from there.
Is there a better way?

Thanks,

-- 
Darren Bentley / Systems Administrator
Borealis Internet / 1-800-667-0307
Prince George, BC, Canada
http://www.pgweb.com


-- 
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] MySql Update.

2002-11-12 Thread David Rice


Making an update query that adapts to the number of fields that are to be 
updated

Is there anyway to do like a for loop to create the values part of the query 
then combine it with the first part of the string.

something like what i have below... although something that works correctly 
as this doesn't.
==

$table is the table name
$num_headers is the number of headers (fieldnames) for that table
$table_headers is an array with the names of the headers
$values is an array with the names of the input boxes on the previous page

==
$query1 = UPDATE .$table. SET  ;

$query2 = ( for ($x=0; $x =$num_headers; $x++){
  . $table_headers[$x] . = . $values[$x] .  , 
  }) ;

$query = $query1.$query2 ;

$result = mysql_query ($query) ;
etc...



_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



Re: [PHP-DB] MySql Update.

2002-11-12 Thread Adam Voigt
$query = UPDATE tablename SET ;
foreach($_POST AS $key = $value)
$query .= $key = '$value',;
$query[strlen($query)-1] = ;
$query .=  WHERE id = '$_GET[id]';

Or something?

On Tue, 2002-11-12 at 13:58, David Rice wrote:
 
 
 Making an update query that adapts to the number of fields that are to be 
 updated
 
 Is there anyway to do like a for loop to create the values part of the query 
 then combine it with the first part of the string.
 
 something like what i have below... although something that works correctly 
 as this doesn't.
 ==
 
 $table is the table name
 $num_headers is the number of headers (fieldnames) for that table
 $table_headers is an array with the names of the headers
 $values is an array with the names of the input boxes on the previous page
 
 ==
 $query1 = UPDATE .$table. SET  ;
 
 $query2 = ( for ($x=0; $x =$num_headers; $x++){
. $table_headers[$x] . = . $values[$x] .  , 
}) ;
 
 $query = $query1.$query2 ;
 
 $result = mysql_query ($query) ;
 etc...
 
 
 
 _
 Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
 http://join.msn.com/?page=features/junkmail
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc



signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB] MySql Update.

2002-11-12 Thread Marco Tabini
How about:

function do_query ($table, $fields, $where)
{
$sql = 'update ' . $table . ' Set ';
foreach ($fields as $k=$v)
$sql = $k . ' = \'' . $v . '\',';
return mysql_query ($sql);
}

Not sure if it adapts 100% to your case but you can probably fix it
up...


Marco


-- 

php|architect - The magazine for PHP Professionals
The monthly worldwide magazine dedicated to PHP programmers

Come visit us at http://www.phparch.com!

---BeginMessage---


Making an update query that adapts to the number of fields that are to be 
updated

Is there anyway to do like a for loop to create the values part of the query 
then combine it with the first part of the string.

something like what i have below... although something that works correctly 
as this doesn't.
==

$table is the table name
$num_headers is the number of headers (fieldnames) for that table
$table_headers is an array with the names of the headers
$values is an array with the names of the input boxes on the previous page

==
$query1 = UPDATE .$table. SET  ;

$query2 = ( for ($x=0; $x =$num_headers; $x++){
  . $table_headers[$x] . = . $values[$x] .  , 
  }) ;

$query = $query1.$query2 ;

$result = mysql_query ($query) ;
etc...



_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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


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


RE: [PHP-DB] payperiods

2002-11-12 Thread Hutchins, Richard
I don't know what your application or requirements are, but here's something
to think about...

If each pay period will ALWAYS be in two week increments from the date you
hard code, then you're fine just hard coding the first one and incrementing
automatically after that. However, if you're in one of those situations
where you get paid every two weeks but there is an odd number of days left
over at the end of the year and you have to pay those out in the current
calendar year, you may run into a snag. In that case, your pay period may
have to encompass 17 days or 11 days instead of the normal 14. Not sure what
your overall application is for, but I know this has crept up to bite me
once before.

Because of this, you might want to give your user(s) an input field or two
to enter a start and end date for the first pay period. After that, have the
remaining ones populate automatically based on a two-week increment and
allow the dates to be edited as required. Most of the time, the dates will
be able to be left alone. Probably only the last ending date in December
will ever have to be altered.

Maybe that's not the best option, but I think you see where I'm going with
this. I might be overthinking this, but I hated going back and changing my
system. Just trying to save you unnecessary pain and suffering.

 -Original Message-
 From: Anderson, Jerrad [mailto:jerrad.anderson;teds.com]
 Sent: Tuesday, November 12, 2002 1:58 PM
 To: Darren Bentley; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] payperiods
 
 
 I would think that the hard coded date is the way I'd do that.
 
 maybe not neccessarily a start_dt, but maybe a pay_pd_st 
 date. This date is just the date the payperiod falls on. You 
 increment it once every two weeks. Have a table in your db 
 with that field and variable. maybe hardcode the very first 
 date. and a pay period date. 
 
 if on linux or unix you can run a cron job to increment that 
 date, or do some calculation to the hardcoded date when 
 displaying a calendar.
 
 hmm... i'm rambling..
 
 -Original Message-
 From: Darren Bentley [mailto:darren;bcgroup.net]
 Sent: Tuesday, November 12, 2002 1:51 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] payperiods
 
 
 Hello,
 
 I have build a php calendar and want to implement 2 week payperiods so
 staff can enter their hours worked. Then I can summarize work done per
 pay period.
 
 Any idea what the easiest way to do this is? I could hard code a
 starting date into a database, then go up 2 weeks at a time 
 from there.
 Is there a better way?
 
 Thanks,
 
 -- 
 Darren Bentley / Systems Administrator
 Borealis Internet / 1-800-667-0307
 Prince George, BC, Canada
 http://www.pgweb.com
 
 
 -- 
 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] payperiods

2002-11-12 Thread Darren Bentley
Our payperiods will always be 2 week increments. 

So if I specify a starting day in the database I need to have that
starting day always updated to the current starting day. (when we switch
to the new payperiod), so as Jerrad mentioned I could use a cron job.

But how would I be able to look at past payperiods? Lets say I want to
view a payperiod from September, then this method won't work.

I'm trying to automate this so employees don't have to specify dates.
They just click the date on the calendar and enter their hours worked
per task.

Then the accountants can go to a summaries page where they can click
on the staff member and view any current and past pay periods.

This sounded easy when I first started :)

Thanks again for the help!

-- 
Darren Bentley / Systems Administrator
Borealis Internet / 1-800-667-0307
Prince George, BC, Canada
http://www.pgweb.com


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




RE: [PHP-DB] payperiods

2002-11-12 Thread Peter Beckman
Put the dates for employees into one table.

In another, put the payperiods.

You could populate the payperiods table for the next 90 years if you wanted
if it is always on a 2 week schedule.

To look at past payperiods:

  select start, end from payperiods where start = '$querydate';

Or just date, but you'll have to decide if the date in the payperiod table
will be the start of the payperiod or end of the payperiod. IE:

  select date as start,date_add(date,interval 14 day) as end from
  payperiods where start = '$querydate';

Then get the employees who put in time between those days, assuming $pp
contains the row found:

  select * from timesheets where date={$pp[start]} and date{$pp[end]};

Then you'd have all of the hours employees put in.  Then just sort by
employee name (add a group by) and/or sum their hours, etc.

Pretty easy.

Peter


On 12 Nov 2002, Darren Bentley wrote:

 Our payperiods will always be 2 week increments.

 So if I specify a starting day in the database I need to have that
 starting day always updated to the current starting day. (when we switch
 to the new payperiod), so as Jerrad mentioned I could use a cron job.

 But how would I be able to look at past payperiods? Lets say I want to
 view a payperiod from September, then this method won't work.

 I'm trying to automate this so employees don't have to specify dates.
 They just click the date on the calendar and enter their hours worked
 per task.

 Then the accountants can go to a summaries page where they can click
 on the staff member and view any current and past pay periods.

 This sounded easy when I first started :)

 Thanks again for the help!

 --
 Darren Bentley / Systems Administrator
 Borealis Internet / 1-800-667-0307
 Prince George, BC, Canada
 http://www.pgweb.com


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


---
Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation
[EMAIL PROTECTED] http://www.purplecow.com/
---


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




RE: [PHP-DB] payperiods

2002-11-12 Thread Darren Bentley
Ok, that makes sense. I have all the payperiods specified in a table to
begin with, then just query selecting all = start  = end.

Thanks,

- Darren

On Tue, 2002-11-12 at 11:29, Peter Beckman wrote:
 Put the dates for employees into one table.
 
 In another, put the payperiods.
 
 You could populate the payperiods table for the next 90 years if you wanted
 if it is always on a 2 week schedule.
 
 To look at past payperiods:
 
   select start, end from payperiods where start = '$querydate';
 
 Or just date, but you'll have to decide if the date in the payperiod table
 will be the start of the payperiod or end of the payperiod. IE:
 
   select date as start,date_add(date,interval 14 day) as end from
   payperiods where start = '$querydate';
 
 Then get the employees who put in time between those days, assuming $pp
 contains the row found:
 
   select * from timesheets where date={$pp[start]} and date{$pp[end]};
 
 Then you'd have all of the hours employees put in.  Then just sort by
 employee name (add a group by) and/or sum their hours, etc.
 
 Pretty easy.
 
 Peter
 
 
 On 12 Nov 2002, Darren Bentley wrote:
 
  Our payperiods will always be 2 week increments.
 
  So if I specify a starting day in the database I need to have that
  starting day always updated to the current starting day. (when we switch
  to the new payperiod), so as Jerrad mentioned I could use a cron job.
 
  But how would I be able to look at past payperiods? Lets say I want to
  view a payperiod from September, then this method won't work.
 
  I'm trying to automate this so employees don't have to specify dates.
  They just click the date on the calendar and enter their hours worked
  per task.
 
  Then the accountants can go to a summaries page where they can click
  on the staff member and view any current and past pay periods.
 
  This sounded easy when I first started :)
 
  Thanks again for the help!
 
  --
  Darren Bentley / Systems Administrator
  Borealis Internet / 1-800-667-0307
  Prince George, BC, Canada
  http://www.pgweb.com
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 ---
 Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation
 [EMAIL PROTECTED] http://www.purplecow.com/
 ---
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
Darren Bentley / Systems Administrator
Borealis Internet / 1-800-667-0307
Prince George, BC, Canada
http://www.pgweb.com


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




[PHP-DB] OT... distribution under the GPL

2002-11-12 Thread Michael Cortes
This is probably off topic..I hope someone can help. 

How do I go about distributing a php program (collection, scripts, whatever) under the 
GPL?

Thank you for any help you may give in pointing me in the right direction.


M.Cortes
Fort LeBoeuf School District


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


[PHP-DB] How to do this..

2002-11-12 Thread Aaron Wolski
Hi All,
 
Need a little help with something.
 
I've created a Search Engine Tracking tool that allows me to measure ROI
from users that comes form search engines using specific keywords..
 
My problem is I forgot to capture a multiple of different identifies
that tell me where the keyword is.
 
To get the identifier I am using:
 
$chunks = explode( '', $string[query]);
 
So for example.. Is this was my search query from the engine:
 
http://www.google.com/search?hl=en
http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=%22help+me%22
ie=UTF-8oe=UTF-8q=%22help+me%22
 
If would be entered into the Db because the keyword identifier is the
 sign.
 
How would I alter the above explode() code to include a bunch of
identifiers.. for example:
 
?
K
R
 
Etc.
 
Any thoughts?
 
Thanks a bunch!

Aaron
 



Re: [PHP-DB] How to do this..

2002-11-12 Thread Jeffrey_N_Dyke

put it inside a preg_split where you say that [?KR] in the brackets are the
possible identifiers, and the brackets are required.  that should work.

i.e $chunks = preg_split( /[?KR]/, $string[query]);

THis would also work with split.


Something like that might work for ya

hth
Jeff


   
 
Aaron Wolski 
 
aaronjw@marte   To: [EMAIL PROTECTED]
 
kbiz.comcc:   
 
 Subject: [PHP-DB] How to do this..
 
11/12/2002 
 
03:01 PM   
 
   
 
   
 




Hi All,

Need a little help with something.

I've created a Search Engine Tracking tool that allows me to measure ROI
from users that comes form search engines using specific keywords..

My problem is I forgot to capture a multiple of different identifies
that tell me where the keyword is.

To get the identifier I am using:

$chunks = explode( '', $string[query]);

So for example.. Is this was my search query from the engine:

http://www.google.com/search?hl=en
http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=%22help+me%22
ie=UTF-8oe=UTF-8q=%22help+me%22

If would be entered into the Db because the keyword identifier is the
 sign.

How would I alter the above explode() code to include a bunch of
identifiers.. for example:

?
K
R

Etc.

Any thoughts?

Thanks a bunch!

Aaron






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




Re: [PHP-DB] OT... distribution under the GPL

2002-11-12 Thread Peter Beckman
SourceForge.net and freshmeat.net both offer Free hosting of Open-source,
GPL software.  SF.net also offers CVS services for keeping revisions
centralized.  Both offer the ability to host tarballs of your collections,
scripts and other useful stuff.  I know on SF.net you can create one
project Cortes-Scripts and create multiple projects under that, allowing
you to keep 30 different scripts as released projects.

Peter

On Tue, 12 Nov 2002, Michael Cortes wrote:

 This is probably off topic..I hope someone can help.

 How do I go about distributing a php program (collection, scripts, whatever) under 
the GPL?

 Thank you for any help you may give in pointing me in the right direction.


 M.Cortes
 Fort LeBoeuf School District



---
Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation
[EMAIL PROTECTED] http://www.purplecow.com/
---

-- 
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] Displaying a single picture...

2002-11-12 Thread Brett Lathrope

I have several thumbnail images spread out in my website.  I thought it
would be cool to write a single PHP script so that when they click on the
thumbnail, the name of the larger pic would be passed to a PHP script that
displays it on its own page...I don't even care about a link back, they can
just click the browser's back arrow.

How do I get the name stored when they click on the thumbnail?

My confusion is, I'm seeing this one dimensionally.  You click on an image,
it calls a link.  But I need to click on the image, store the name of the
pic I want to display, then call the PHP link.

I've looked at some of the free Image Lib PHP scripts out thereand they
all go wy overboard on what I'm looking to do.

Any suggestions?

Thanks



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




RE: [PHP-DB] Displaying a single picture...

2002-11-12 Thread Hutchins, Richard
The link for your image:
a href=displaypage.php?image=imagename.jpg target=_blankClick Here/a


The code for displaypage.php
HTML
head
blah...
/head
body
?php
echo img src=\.$_GET[image].\
?
/body
/HTML
Something like this should be all you'll need. A little more HTML here and
there should help you position and size your image.

Hope this helps.
Rich

 -Original Message-
 From: Brett Lathrope [mailto:brett;lathrope.com]
 Sent: Tuesday, November 12, 2002 4:44 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Displaying a single picture...
 
 
 
 I have several thumbnail images spread out in my website.  I 
 thought it
 would be cool to write a single PHP script so that when they 
 click on the
 thumbnail, the name of the larger pic would be passed to a 
 PHP script that
 displays it on its own page...I don't even care about a link 
 back, they can
 just click the browser's back arrow.
 
 How do I get the name stored when they click on the thumbnail?
 
 My confusion is, I'm seeing this one dimensionally.  You 
 click on an image,
 it calls a link.  But I need to click on the image, store the 
 name of the
 pic I want to display, then call the PHP link.
 
 I've looked at some of the free Image Lib PHP scripts out 
 thereand they
 all go wy overboard on what I'm looking to do.
 
 Any suggestions?
 
 Thanks
 
 
 
 -- 
 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] Variable from PHP to HTML...

2002-11-12 Thread NIPP, SCOTT V (SBCSI)
I am attempting to create a form of system names that is populated
from a database query.  The database query is working fine, and the form
population is actually working fine also.  The question I have is about
organizing the variables that result from the form.  I want to use the
system name as the variable name but I am having trouble figuring out how to
do this.  Below is what I currently have working:

form name=form1 method=post action=
table border=0 align=center
  ?php do {
$sys = $system['Name'];
if ($cnt == 1) { 
$cnt = 2; 
echo tr; ?
td width=161input name=system type=checkbox value=name 
  ?php echo $sys; ?/td

I would like to be able to access this variable $sys from the HTML
code.  Is this possible?  I am thinking something like this, but it doesn't
appear to work:

form name=form1 method=post action=
table border=0 align=center
  ?php do {
$sys = $system['Name'];
if ($cnt == 1) { 
$cnt = 2; 
echo tr; ?
td width=161input name=$sys type=checkbox value=name 
  ?php echo $sys; ?/td

Thanks in advance for the help.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



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




Re: [PHP-DB] Variable from PHP to HTML...

2002-11-12 Thread Lisi



form name=form1 method=post action=
table border=0 align=center
  ?php do {
$sys = $system['Name'];
if ($cnt == 1) {
$cnt = 2;
echo tr; ?
td width=161input name=$sys type=checkbox value=name
  ?php echo $sys; ?/td


Your input box should be the following:

input name=sys type=checkbox value=name



The $ isn't necessary in the HTML code since HTML doesn't really recognize 
this as a variable. When the form is passed to the action page, the code in 
the action page (in this case PHP) creates a variable named whatever the 
name attribute in the HTML code holds - in this case sys.

-Lisi


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



Re: [PHP-DB] Access a Flat File DB - How?

2002-11-12 Thread Crony
On another topic...Does MySQL handle record locking and prevent multiple
open edits by different users?

Maxim Maletsky [EMAIL PROTECTED] wrote in message
news:20021112130532.1DE5.MAXIM;php.net...

 Risks are to share properly the data. You can never rely on the accuracy
 of data in the flat files as those could be changing at the same
 instance as your application is reading it. RDMS (not mySQL) can handle
 it under relational logic mechanisms, meaning they would not read the
 data that is currently being written and would not write the data that
 is currently being read.


 --
 Maxim Maletsky
 [EMAIL PROTECTED]



 Crony [EMAIL PROTECTED] wrote... :

  I have written a few small apps in PHP and MySQL. These were mostly
copy,
  paste and change and fairly easy. I now wnat ot connect to a flat file
dbase
  that is used by another enterprise app. Then I want to start normal PHP
  programming. Is there any risk in doing this? Where do I start?
 
 
 
 
  --
  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] small database

2002-11-12 Thread Seabird
Hi everyone,

I'm creating a sample site for a company that does aircraft sales. I use a
MySQL DB to store all the info of the available aircraft. Now, I would like
to store pictures directly inside that same table, so that on the details
page, it would provide a picture out of (for example) Field5. Is this
possible and if so how? (I tried blob etc., but can't get it to work).

Thanx,
Jacco
--
http://seabird.jmtech.ca

Attitude is Everything!
But Remember, Attitudes are Contagious!
Is Yours worth Catching



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




RE: [PHP-DB] small database

2002-11-12 Thread Rich Hutchins
As you'll probably see in a lot of responses, it might be better to store
the pictures in a folder on the server and store only the path to the
pictures in the db.  That keeps the size of the db smaller.

If you choose to do that, use an HTML form with
enctype=multipart/form-data and an input type=file element, send it to a
PHP script to upload the file, move it to a specified directory and put the
path and the filname in a table in your db. Then, when you need to display
an image, just grab the path and insert it in an img src= tag.

I don't know how to store an image directly in a database since I always
store just the path. Sorry.

HTH,
Rich
-Original Message-
From: Seabird [mailto:jacco;vliegt.nl]
Sent: Tuesday, November 12, 2002 11:56 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] small database


Hi everyone,

I'm creating a sample site for a company that does aircraft sales. I use a
MySQL DB to store all the info of the available aircraft. Now, I would like
to store pictures directly inside that same table, so that on the details
page, it would provide a picture out of (for example) Field5. Is this
possible and if so how? (I tried blob etc., but can't get it to work).

Thanx,
Jacco
--
http://seabird.jmtech.ca

Attitude is Everything!
But Remember, Attitudes are Contagious!
Is Yours worth Catching



--
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: Displaying a single picture...

2002-11-12 Thread Jonathan Narong
not sure i understand why you would need to use a php script for this? why
not just use a static html img tag, if all you're doing is opening the
picture in a new window?

-jon

-Original Message-
From: Brett Lathrope [mailto:brett;lathrope.com]
Sent: Tuesday, November 12, 2002 1:44 PM
To: [EMAIL PROTECTED]
Subject: Displaying a single picture...



I have several thumbnail images spread out in my website.  I thought it
would be cool to write a single PHP script so that when they click on the
thumbnail, the name of the larger pic would be passed to a PHP script that
displays it on its own page...I don't even care about a link back, they can
just click the browser's back arrow.

How do I get the name stored when they click on the thumbnail?

My confusion is, I'm seeing this one dimensionally.  You click on an image,
it calls a link.  But I need to click on the image, store the name of the
pic I want to display, then call the PHP link.

I've looked at some of the free Image Lib PHP scripts out thereand they
all go wy overboard on what I'm looking to do.

Any suggestions?

Thanks





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




RE: [PHP-DB] Access a Flat File DB - How?

2002-11-12 Thread John W. Holmes
 On another topic...Does MySQL handle record locking and prevent
multiple
 open edits by different users?

Yes.

---John Holmes...



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




[PHP-DB] RE: date questions in mySql

2002-11-12 Thread Jonathan Narong
yes, you need to insert the date as -mm-dd. you can go around this and
still have the user see a form field with mm/dd/ but you need to break
each part down, and play with the string functions so the final mysql query
is in -mm-dd.

-jon

-Original Message-
From: Paul Ihrig [mailto:pihrig;columbus.rr.com]
Sent: Tuesday, November 12, 2002 6:27 AM
To: [EMAIL PROTECTED]
Subject: date questions in mySql


ok i can parse a date from mySql date field
so it displays as: 08/06/1972
but if i insert it into the field in this format
then the date gets hosed.

do i have to insert as -mm-dd
can i have a form field that has mm/dd/
but then change it on insert?
how would i do this?

thanks.
-paul



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




RE: [PHP-DB] RE: Displaying a single picture...

2002-11-12 Thread John W. Holmes
 I have several thumbnail images spread out in my website.  I thought
it
 would be cool to write a single PHP script so that when they click on
the
 thumbnail, the name of the larger pic would be passed to a PHP script
that
 displays it on its own page...I don't even care about a link back,
they
 can
 just click the browser's back arrow.
 
 How do I get the name stored when they click on the thumbnail?
 
 My confusion is, I'm seeing this one dimensionally.  You click on an
 image,
 it calls a link.  But I need to click on the image, store the name of
the
 pic I want to display, then call the PHP link.

Hmmm... how about:

a href=display.php?image=foo.jpgimg src=foo.jpg/a

??

---John Holmes...



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




[PHP-DB] can i create an Access table or mdb with PHP?

2002-11-12 Thread John A DAVIS
Want to give the user the ability to download a dynamic Access.mdb file that has a 
table and linked report formatted for Avery 5160 labels. Know how to create all this 
stuff in VBA code, but not using PHP.


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




Re: [PHP-DB] small database

2002-11-12 Thread Hatem Ben
Check the PHP-DB archives ;-)
http://news.php.net/article.php?group=php.dbarticle=22433

Hatem

- Original Message -
From: Rich Hutchins [EMAIL PROTECTED]
To: Seabird [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, November 13, 2002 12:24 AM
Subject: RE: [PHP-DB] small database


 As you'll probably see in a lot of responses, it might be better to store
 the pictures in a folder on the server and store only the path to the
 pictures in the db.  That keeps the size of the db smaller.

 If you choose to do that, use an HTML form with
 enctype=multipart/form-data and an input type=file element, send it to
a
 PHP script to upload the file, move it to a specified directory and put
the
 path and the filname in a table in your db. Then, when you need to display
 an image, just grab the path and insert it in an img src= tag.

 I don't know how to store an image directly in a database since I always
 store just the path. Sorry.

 HTH,
 Rich
 -Original Message-
 From: Seabird [mailto:jacco;vliegt.nl]
 Sent: Tuesday, November 12, 2002 11:56 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] small database


 Hi everyone,

 I'm creating a sample site for a company that does aircraft sales. I use a
 MySQL DB to store all the info of the available aircraft. Now, I would
like
 to store pictures directly inside that same table, so that on the
details
 page, it would provide a picture out of (for example) Field5. Is this
 possible and if so how? (I tried blob etc., but can't get it to work).

 Thanx,
 Jacco
 --
 http://seabird.jmtech.ca

 Attitude is Everything!
 But Remember, Attitudes are Contagious!
 Is Yours worth Catching



 --
 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] Re: Displaying a single picture...

2002-11-12 Thread Adam Royle
You could do something as simple as this:

a href=displayPic.php?image=/path/to/image.jpgtitle=This is my titleimg 
src=/thumb.jpg border=0/a

I think most browsers will convert the spaces in the link (when clicked) to '+' or 
'%20', but this may not be true with some less popular browsers (i don't know).

Then displayPic.php might be something like this (if you have latest PHP version):

displayPic.php 

?php

$image = isset($_GET['image']) ? $_GET['image'] : /unknown_pic.jpg;
$title = isset($_GET['title]) ? $_GET['title] : /lost_title.jpg;

?
img src=?= $image ?br
?= $title %

--

Hope this helps
Adam

--- Original Message ---
I have several thumbnail images spread out in my website.  I thought it
would be cool to write a single PHP script so that when they click on the
thumbnail, the name of the larger pic would be passed to a PHP script that
displays it on its own page...I don't even care about a link back, they can
just click the browser's back arrow.

How do I get the name stored when they click on the thumbnail?

My confusion is, I'm seeing this one dimensionally.  You click on an image,
it calls a link.  But I need to click on the image, store the name of the
pic I want to display, then call the PHP link.

I've looked at some of the free Image Lib PHP scripts out thereand they
all go wy overboard on what I'm looking to do.

Any suggestions?

Thanks




Re: [PHP-DB] Variable from PHP to HTML...

2002-11-12 Thread Peter Beckman
If the last reply didn't help you, try this:

tdinput name=?php echo $sys; ? type=checkbox value=name?php echo $sys; 
?/td

Another way to write, if you aren't worried about ? being used by another
processor:

tdinput name=?=$sys? type=checkbox value=name?=$sys?/td

Peter

On Tue, 12 Nov 2002, NIPP, SCOTT V (SBCSI) wrote:

   I am attempting to create a form of system names that is populated
 from a database query.  The database query is working fine, and the form

 form name=form1 method=post action=
 table border=0 align=center
   ?php do {
 $sys = $system['Name'];
 if ($cnt == 1) {
   $cnt = 2;
   echo tr; ?
 td width=161input name=$sys type=checkbox value=name
   ?php echo $sys; ?/td

---
Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation
[EMAIL PROTECTED] http://www.purplecow.com/
---


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




Re: [PHP-DB] can i create an Access table or mdb with PHP?

2002-11-12 Thread Peter Beckman
On Tue, 12 Nov 2002, John A DAVIS wrote:

 Want to give the user the ability to download a dynamic Access.mdb file
 that has a table and linked report formatted for Avery 5160 labels. Know
 how to create all this stuff in VBA code, but not using PHP.

 It is better to give too much information than not enough.

 You are trying to generate a dynamic Access.mdb file on the fly, using
 PHP?  Or you are trying to deliver this already existing file that changes
 sometimes with PHP?  Or you are trying to do something else?

 If the first option, where is your data coming from?

 If the second, why are you trying to use PHP instead of just linking to
 the Access.mdb file via the web server?

Peter
---
Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation
[EMAIL PROTECTED] http://www.purplecow.com/
---


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




[PHP-DB] php with mssql

2002-11-12 Thread soff
hello,

  I am trying to connect mssql with php, when I use mssql_pconnect(), It
will fail to connect when the amount of visitors becomes large. But,
when I use mssql_connect(), I can only run SELECT quern, while the
INSERT/UPDATE staments doesn't work. Can somebody tell me why? thanks
and sorry for my poor English :P

-- 
Welcome to http://www.soff.net



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