Re: [PHP-DB] Help Needed

2002-12-26 Thread adi setiawan
-- pada 2002-12-26, 14:36:00 [EMAIL PROTECTED] menulis: --

 
Hi. 
I juz installed a RedHat 8.0 on my machine.
But then I have a problem in configuring Apache 2.0.4 to use PHP 4.20..
It's preety weird.. coz there's nothing shown up in the browser when I
run phpinfo(); or even a simple 'helloworld' code.
When I view the source by right-clicking.. it shows the php code.. but
why it didn't show anything in the browser ???
 
I've done all the procedures according to manual. but not working at
all.

check httpd.conf or something similar  make sure correct .php parsing

salam,
adi s. 




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




[PHP-DB] php/mysql

2002-12-26 Thread Martin S
I don't know where the error lays, in php, mysql or red hat 8.
But, I can't get my databased php-apps to work. 
I am trying to run:

apache_1.3.27
php-4.2.3
mysql-3.23.53
redhat 8.0

What happens is that apache and php work nicely, but my apps cannot connect 
to mysql. In IRM I get can not connect to database, and in phpgroupware I 
get the the thing up and running, but can't add anything to the tables.
E.g. I can't add a to-do even if the routine runs normally, nothing is added 
in the db table.

I saw a suggestion on a mysql mail list suggesting symlinking mysql.sock to 
/tmp but that does no difference.


Any suggestions?

/Martin S.

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




RE: [PHP-DB] Help Needed

2002-12-26 Thread dufronte
Everything's perfect.. except my browser keep blank when I run my php
files...


--www.kapsul.org--
  DuFronte

-Original Message-
From: adi setiawan [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 26, 2002 5:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Help Needed

-- pada 2002-12-26, 14:36:00 [EMAIL PROTECTED] menulis: --

 
Hi. 
I juz installed a RedHat 8.0 on my machine.
But then I have a problem in configuring Apache 2.0.4 to use PHP 4.20..
It's preety weird.. coz there's nothing shown up in the browser when I
run phpinfo(); or even a simple 'helloworld' code.
When I view the source by right-clicking.. it shows the php code.. but
why it didn't show anything in the browser ???
 
I've done all the procedures according to manual. but not working at
all.

check httpd.conf or something similar  make sure correct .php parsing

salam,
adi s. 




-- 
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] Help Needed

2002-12-26 Thread 1LT John W. Holmes
 Everything's perfect.. except my browser keep blank when I run my php
 files...

No, obviously it's not perfect because it's not working at all. Your page is
blank because ? phpinfo() ? will be evaluated as an unknown HTML tag and
come out blank.

Find another tutorial that discusses how to set up what you want and follow
it step by step.

---John Holmes...

 I juz installed a RedHat 8.0 on my machine.
 But then I have a problem in configuring Apache 2.0.4 to use PHP 4.20..
 It's preety weird.. coz there's nothing shown up in the browser when I
 run phpinfo(); or even a simple 'helloworld' code.
 When I view the source by right-clicking.. it shows the php code.. but
 why it didn't show anything in the browser ???
 
 I've done all the procedures according to manual. but not working at
 all.

 check httpd.conf or something similar  make sure correct .php parsing


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




Re: [PHP-DB] php/mysql

2002-12-26 Thread 1LT John W. Holmes
 I don't know where the error lays, in php, mysql or red hat 8.
 But, I can't get my databased php-apps to work.
 I am trying to run:

 apache_1.3.27
 php-4.2.3
 mysql-3.23.53
 redhat 8.0

 What happens is that apache and php work nicely, but my apps cannot
connect
 to mysql. In IRM I get can not connect to database, and in phpgroupware I
 get the the thing up and running, but can't add anything to the tables.
 E.g. I can't add a to-do even if the routine runs normally, nothing is
added
 in the db table.

 I saw a suggestion on a mysql mail list suggesting symlinking mysql.sock
to
 /tmp but that does no difference.

Can you connect to MySQL from the command line? With what user? Are you sure
you are using a valid login and password in your programs?

---John Holmes...


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




RE: [PHP-DB] How to solve T_STRING error?

2002-12-26 Thread Josh Johnson
I'd have to see all of your code, but I'm guessing you've left open a
paren or a quotation mark, or a ?php ? block or forgot a
semi-colon...probably in a file included before this code is called. 

Also, you may want to look into how PHP handles null values (I'm pretty
sure they evaluate to false, but look into it), and try to verify that
$user2-permissionCheck(tech); is returning a true/false/0/1 sort of
result. 

-- Josh

 -Original Message-
 From: Martin S [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 25, 2002 8:44 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] How to solve T_STRING error?
 
 Just one page still to do. And I'm stuck.
 I keep getting:
 
 Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
 `T_NUM_STRING' in /www/htdocs/dev/users/tracking-update.php on line 43
 
 ON this code:
 
 AuthCheck(post-only);
 commonHeader(IRM Tracking - Update Information);
 PRINT a href=\$HTTP_REFERER\Go Back/ahr noshadebr;
 $datenow = date(Y-m-d H:i:s);
 $user2 = new User($IRMName);
 $type = $user2-getType();
 $permissions = $user2-permissionCheck(tech);
 $track = new Tracking($tID);
 $isStat = $track-isStatus($status);
 $isAssign = $track-isAssign($user);
 $query = select dev_group from tracking where (ID=$tID);
 $sth = $adb-prepare($query);
 if($sth)
 {
 $res = $sth-execute();
 $result = $sth-fetchrow_hash();
 $dev_group = $result[dev_group];
 }
 if($permissions)// This is line 43
 {
 if(!$isStat)
 {
 
 
 and I can't see what ever is wrong! Probably have been looking too
much at
 it. Anyone who can see an error in here somewhere?
 
 /Martin S.
 
 --
 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] php/mysql

2002-12-26 Thread Mark
I don't use RedHat, but I've heard (possibly here) that the RH PHP
RPM does not *properly* install MySQL support by default and that
there's something like php_mysql.rpm (or something similar) that
needs to be installed as well? Does any of that sound familiar to
anyone?

Have I qualified that enough? ;-)

M



--- 1LT John W. Holmes [EMAIL PROTECTED] wrote:
  I don't know where the error lays, in php, mysql or red hat 8.
  But, I can't get my databased php-apps to work.
  I am trying to run:
 
  apache_1.3.27
  php-4.2.3
  mysql-3.23.53
  redhat 8.0
 
  What happens is that apache and php work nicely, but my apps
 cannot
 connect
  to mysql. In IRM I get can not connect to database, and in
 phpgroupware I
  get the the thing up and running, but can't add anything to the
 tables.
  E.g. I can't add a to-do even if the routine runs normally,
 nothing is
 added
  in the db table.
 
  I saw a suggestion on a mysql mail list suggesting symlinking
 mysql.sock
 to
  /tmp but that does no difference.
 
 Can you connect to MySQL from the command line? With what user? Are
 you sure
 you are using a valid login and password in your programs?
 
 ---John Holmes...
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
-Stolen from the now-defunct Randy's Random mailing list.
***

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP-DB] php/mysql

2002-12-26 Thread Martin S
1lt John W. Holmes wrote:

 I don't know where the error lays, in php, mysql or red hat 8.
 But, I can't get my databased php-apps to work.
 I am trying to run:

 apache_1.3.27
 php-4.2.3
 mysql-3.23.53
 redhat 8.0

 What happens is that apache and php work nicely, but my apps cannot
 connect
 to mysql. In IRM I get can not connect to database, and in phpgroupware I
 get the the thing up and running, but can't add anything to the tables.
 E.g. I can't add a to-do even if the routine runs normally, nothing is
 added
 in the db table.

 I saw a suggestion on a mysql mail list suggesting symlinking mysql.sock
 to
 /tmp but that does no difference.
 
 Can you connect to MySQL from the command line? With what user? 

mysql -u ADMIN -pADMINPW irm
mysql -u ADMIN -pADMINPW phpgroupware

both work (command line access). Setting the user in IRM as ADMIN and the 
password to ADMINPW I get Cannot connect to database.
I once desperately thought I had forgotten to configure php --with-mysql so 
I recompiled. No improvement.

Are you
 sure you are using a valid login and password in your programs?

Yes. I'll recheck though.

/Martin S.



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




RE: [PHP-DB] How to solve T_STRING error?

2002-12-26 Thread Martin S
Josh Johnson wrote:

 I'd have to see all of your code, but I'm guessing you've left open a
 paren or a quotation mark, or a ?php ? block or forgot a
 semi-colon...probably in a file included before this code is called.
 
 Also, you may want to look into how PHP handles null values (I'm pretty
 sure they evaluate to false, but look into it), and try to verify that
 $user2-permissionCheck(tech); is returning a true/false/0/1 sort of
 result.

You are seeing everything down to line 43 (except an include statement as 
you guessed*). If I comment out the db lookup, 
the page works. Although not as intended (which the db-routine is supposed 
to fix).

I'll have another look though.

/Martin S.

* which is hell to debug, it's a 3500+ lines beastie.

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




Re: [PHP-DB] php/mysql

2002-12-26 Thread Martin S
Mark wrote:

 I don't use RedHat, but I've heard (possibly here) that the RH PHP
 RPM does not properly install MySQL support by default and that
 there's something like php_mysql.rpm (or something similar) that
 needs to be installed as well? Does any of that sound familiar to
 anyone?
 
I've heard something like that as well, which is why I've compiled php and
apache from source. Would compiling mysql from source as well help I 
wonder...

/Martin S.

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




Re: [PHP-DB] php/mysql

2002-12-26 Thread 1LT John W. Holmes
  I don't use RedHat, but I've heard (possibly here) that the RH PHP
  RPM does not properly install MySQL support by default and that
  there's something like php_mysql.rpm (or something similar) that
  needs to be installed as well? Does any of that sound familiar to
  anyone?
 
 I've heard something like that as well, which is why I've compiled php and
 apache from source. Would compiling mysql from source as well help I
 wonder...

It seems like you'd get an unknown function error if PHP wasn't compiled
correctly with MySQL support, though.

Are you sure you're programs are connecting with the host you think they
are? Maybe they are trying to connect with user@computer_name and you've got
it set up as user@localhost in the mysql.user table??

Grasping at straws...

---John Holmes...


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




Re: [PHP-DB] php/mysql

2002-12-26 Thread 1LT John W. Holmes
  I don't know where the error lays, in php, mysql or red hat 8.
  But, I can't get my databased php-apps to work.
  I am trying to run:
 
  apache_1.3.27
  php-4.2.3
  mysql-3.23.53
  redhat 8.0
 
  What happens is that apache and php work nicely, but my apps cannot
  connect
  to mysql. In IRM I get can not connect to database, and in phpgroupware
I
  get the the thing up and running, but can't add anything to the tables.
  E.g. I can't add a to-do even if the routine runs normally, nothing is
  added
  in the db table.
 
  I saw a suggestion on a mysql mail list suggesting symlinking
mysql.sock
  to
  /tmp but that does no difference.
 
  Can you connect to MySQL from the command line? With what user?

 mysql -u ADMIN -pADMINPW irm
 mysql -u ADMIN -pADMINPW phpgroupware

 both work (command line access). Setting the user in IRM as ADMIN and the
 password to ADMINPW I get Cannot connect to database.
 I once desperately thought I had forgotten to configure php --with-mysql
so
 I recompiled. No improvement.

What is IRM? What's the line with mysql_connect() look like? Make sure there
is no @ in the line, as in @mysql_connect, which will suppress any normal
error messages.

---John Holmes...


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




[PHP-DB] php/sybase

2002-12-26 Thread Lancelot Hack
any short functions to just test the connectivity and config between php and
sybase?
becoz i just want to know if i compile php in the right way

i just tested my apache works with php perfectly by making just several
lines of html and php calling phpinfo()

is there any call like this one so that i know my sybase up and running?

thx a lot



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




Re: [PHP-DB] Cannot add header information error

2002-12-26 Thread Leif K-Brooks
You can't add headers after you've outputted anything.  Without seeing 
the class page, I'd guess there's a space after the ?.  Either remove 
that or use output buffering.

Petre NICOARA wrote:

Hi guys
I have this error when I tried to use a sign-up form.
The thing is that I use some classes for database interaction, and I
respond by 
return Values; 
to the functions.
Also, in line 18 in  page.php I have this 
Header(Location: page1.php?string=value);
The Line 363 marks the class end ?

Warning: Cannot add header information - headers already sent by (output
started at classes/member_class.php:363) in F:\Web Applications\My
work\site\page.php on line 18

Could someone explain what is happening, the code is clear.

Thanks



 


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




RE: [PHP-DB] Re: NewB: Return New Record ID...

2002-12-26 Thread Ryan Jameson (USA)
for MS SQL and Oracle does anyone know a more reliable way to do this than select 
max(ID) immediately after the insert? It seems silly that I'd have to take my chances 
that another has been inserted in between.

 Ryan

-Original Message-
From: J.Veenhuijsen [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 1:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: NewB: Return New Record ID...


Try $last=mysql_insert_id();

Jochem

Doug Coning wrote:
 Hi all,
 
 How do I do this:
 
 I need a PHP page that simply creates a blank record so that I have the
 record's ID (which is automatically generated).  That same page then needs
 to return the record ID back so that I know what the ID is.  I will later
 allow that record's information to be populated based on the ID it first
 returned.
 
 How would I do this?
 
 Thank you, thank you!
 
 Doug Coning
 
 
 


-- 
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: NewB: Return New Record ID...

2002-12-26 Thread Bernain, Fernando G.
This is from de books online (MSSQL).

@@IDENTITY (T-SQL)
Returns the last-inserted identity value. 

Syntax
@@IDENTITY

Return Types
numeric

Remarks
After an INSERT, SELECT INTO, or bulk copy statement completes, @@IDENTITY
contains the last identity value generated by the statement. If the
statement did not affect any tables with identity columns, @@IDENTITY
returns NULL. If multiple rows are inserted, generating multiple identity
values, @@IDENTITY returns the last identity value generated. If the
statement fires one or more triggers that perform inserts that generate
identity values, calling @@IDENTITY immediately after the statement returns
the last identity value generated by the triggers. The @@IDENTITY value does
not revert to a previous setting if the INSERT or SELECT INTO statement or
bulk copy fails, or if the transaction is rolled back.

Examples
This example inserts a row into a table with an identity column and uses
@@IDENTITY to display the identity value used in the new row.

INSERT INTO jobs (job_desc,min_lvl,max_lvl)

VALUES ('Accountant',12,125)

SELECT @@IDENTITY AS 'Identity'

  

Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]




-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


for MS SQL and Oracle does anyone know a more reliable way to do this than
select max(ID) immediately after the insert? It seems silly that I'd have to
take my chances that another has been inserted in between.

 Ryan

-Original Message-
From: J.Veenhuijsen [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 1:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: NewB: Return New Record ID...


Try $last=mysql_insert_id();

Jochem

Doug Coning wrote:
 Hi all,
 
 How do I do this:
 
 I need a PHP page that simply creates a blank record so that I have the
 record's ID (which is automatically generated).  That same page then needs
 to return the record ID back so that I know what the ID is.  I will later
 allow that record's information to be populated based on the ID it first
 returned.
 
 How would I do this?
 
 Thank you, thank you!
 
 Doug Coning
 
 
 


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


Email Disclaimer

The information in this email is confidential and may be
legally privileged.
It is intended solely for the addressee.
Access to this email by anyone else is unauthorised.
If you are not the intended recipient, any disclosure,
copying, distribution
or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful.
When addressed to our clients any opinions or advice
contained in this email are subject to the terms and
conditions expressed in the governing KPMG client engagement
letter.


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




RE: [PHP-DB] Re: NewB: Return New Record ID...

2002-12-26 Thread Ryan Jameson (USA)
This doesn't work as expected through ODBC... it does not seem to return any value...

 Ryan

-Original Message-
From: Bernain, Fernando G. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 10:09 AM
To: Ryan Jameson (USA)
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


This is from de books online (MSSQL).

@@IDENTITY (T-SQL)
Returns the last-inserted identity value. 

Syntax
@@IDENTITY

Return Types
numeric

Remarks
After an INSERT, SELECT INTO, or bulk copy statement completes, @@IDENTITY
contains the last identity value generated by the statement. If the
statement did not affect any tables with identity columns, @@IDENTITY
returns NULL. If multiple rows are inserted, generating multiple identity
values, @@IDENTITY returns the last identity value generated. If the
statement fires one or more triggers that perform inserts that generate
identity values, calling @@IDENTITY immediately after the statement returns
the last identity value generated by the triggers. The @@IDENTITY value does
not revert to a previous setting if the INSERT or SELECT INTO statement or
bulk copy fails, or if the transaction is rolled back.

Examples
This example inserts a row into a table with an identity column and uses
@@IDENTITY to display the identity value used in the new row.

INSERT INTO jobs (job_desc,min_lvl,max_lvl)

VALUES ('Accountant',12,125)

SELECT @@IDENTITY AS 'Identity'

  

Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]




-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


for MS SQL and Oracle does anyone know a more reliable way to do this than
select max(ID) immediately after the insert? It seems silly that I'd have to
take my chances that another has been inserted in between.

 Ryan

-Original Message-
From: J.Veenhuijsen [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 1:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: NewB: Return New Record ID...


Try $last=mysql_insert_id();

Jochem

Doug Coning wrote:
 Hi all,
 
 How do I do this:
 
 I need a PHP page that simply creates a blank record so that I have the
 record's ID (which is automatically generated).  That same page then needs
 to return the record ID back so that I know what the ID is.  I will later
 allow that record's information to be populated based on the ID it first
 returned.
 
 How would I do this?
 
 Thank you, thank you!
 
 Doug Coning
 
 
 


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


Email Disclaimer

The information in this email is confidential and may be
legally privileged.
It is intended solely for the addressee.
Access to this email by anyone else is unauthorised.
If you are not the intended recipient, any disclosure,
copying, distribution
or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful.
When addressed to our clients any opinions or advice
contained in this email are subject to the terms and
conditions expressed in the governing KPMG client engagement
letter.


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




RE: [PHP-DB] Re: NewB: Return New Record ID...

2002-12-26 Thread Bernain, Fernando G.
You can use this inside an stored procedure, for instance:

CREATE PROCEDURE SP_INSERT_TRANSACCION
@transacfecha datetime,
@observacion char(100)
 AS
INSERT INTO Transaccion(transacfecha, observacion)
VALUES(
@transacfecha,
@observacion
)
SELECT @@IDENTITY AS 'nrotrans'
END

In this example, I insert two values with this sp in a table with and
Identity column. So, the SP return the value of the transaccion generated...
You've got the idea???


Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]




-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:36 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


This doesn't work as expected through ODBC... it does not seem to return any
value...

 Ryan

-Original Message-
From: Bernain, Fernando G. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 10:09 AM
To: Ryan Jameson (USA)
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


This is from de books online (MSSQL).

@@IDENTITY (T-SQL)
Returns the last-inserted identity value. 

Syntax
@@IDENTITY

Return Types
numeric

Remarks
After an INSERT, SELECT INTO, or bulk copy statement completes, @@IDENTITY
contains the last identity value generated by the statement. If the
statement did not affect any tables with identity columns, @@IDENTITY
returns NULL. If multiple rows are inserted, generating multiple identity
values, @@IDENTITY returns the last identity value generated. If the
statement fires one or more triggers that perform inserts that generate
identity values, calling @@IDENTITY immediately after the statement returns
the last identity value generated by the triggers. The @@IDENTITY value does
not revert to a previous setting if the INSERT or SELECT INTO statement or
bulk copy fails, or if the transaction is rolled back.

Examples
This example inserts a row into a table with an identity column and uses
@@IDENTITY to display the identity value used in the new row.

INSERT INTO jobs (job_desc,min_lvl,max_lvl)

VALUES ('Accountant',12,125)

SELECT @@IDENTITY AS 'Identity'

  

Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]




-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


for MS SQL and Oracle does anyone know a more reliable way to do this than
select max(ID) immediately after the insert? It seems silly that I'd have to
take my chances that another has been inserted in between.

 Ryan

-Original Message-
From: J.Veenhuijsen [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 1:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: NewB: Return New Record ID...


Try $last=mysql_insert_id();

Jochem

Doug Coning wrote:
 Hi all,
 
 How do I do this:
 
 I need a PHP page that simply creates a blank record so that I have the
 record's ID (which is automatically generated).  That same page then needs
 to return the record ID back so that I know what the ID is.  I will later
 allow that record's information to be populated based on the ID it first
 returned.
 
 How would I do this?
 
 Thank you, thank you!
 
 Doug Coning
 
 
 


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


Email Disclaimer

The information in this email is confidential and may be
legally privileged.
It is intended solely for the addressee.
Access to this email by anyone else is unauthorised.
If you are not the intended recipient, any disclosure,
copying, distribution
or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful.
When addressed to our clients any opinions or advice
contained in this email are subject to the terms and
conditions expressed in the governing KPMG client engagement
letter.


-- 
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: NewB: Return New Record ID...

2002-12-26 Thread Ryan Jameson (USA)
The problem is I have hundreds of tables each with a different column list and syntax, 
I don't want to have to create a SP for each table. There really has to be an easy way 
to do this. Now my sql server is saying this:

Connection is busy with results for another hstmt, SQL state S1000

. it looks like I'll have to take my chances with select max() 

 Ryan

-Original Message-
From: Bernain, Fernando G. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 10:43 AM
To: Ryan Jameson (USA)
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


You can use this inside an stored procedure, for instance:

CREATE PROCEDURE SP_INSERT_TRANSACCION
@transacfecha datetime,
@observacion char(100)
 AS
INSERT INTO Transaccion(transacfecha, observacion)
VALUES(
@transacfecha,
@observacion
)
SELECT @@IDENTITY AS 'nrotrans'
END

In this example, I insert two values with this sp in a table with and
Identity column. So, the SP return the value of the transaccion generated...
You've got the idea???


Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]




-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:36 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


This doesn't work as expected through ODBC... it does not seem to return any
value...

 Ryan

-Original Message-
From: Bernain, Fernando G. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 10:09 AM
To: Ryan Jameson (USA)
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


This is from de books online (MSSQL).

@@IDENTITY (T-SQL)
Returns the last-inserted identity value. 

Syntax
@@IDENTITY

Return Types
numeric

Remarks
After an INSERT, SELECT INTO, or bulk copy statement completes, @@IDENTITY
contains the last identity value generated by the statement. If the
statement did not affect any tables with identity columns, @@IDENTITY
returns NULL. If multiple rows are inserted, generating multiple identity
values, @@IDENTITY returns the last identity value generated. If the
statement fires one or more triggers that perform inserts that generate
identity values, calling @@IDENTITY immediately after the statement returns
the last identity value generated by the triggers. The @@IDENTITY value does
not revert to a previous setting if the INSERT or SELECT INTO statement or
bulk copy fails, or if the transaction is rolled back.

Examples
This example inserts a row into a table with an identity column and uses
@@IDENTITY to display the identity value used in the new row.

INSERT INTO jobs (job_desc,min_lvl,max_lvl)

VALUES ('Accountant',12,125)

SELECT @@IDENTITY AS 'Identity'

  

Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]




-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


for MS SQL and Oracle does anyone know a more reliable way to do this than
select max(ID) immediately after the insert? It seems silly that I'd have to
take my chances that another has been inserted in between.

 Ryan

-Original Message-
From: J.Veenhuijsen [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 1:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: NewB: Return New Record ID...


Try $last=mysql_insert_id();

Jochem

Doug Coning wrote:
 Hi all,
 
 How do I do this:
 
 I need a PHP page that simply creates a blank record so that I have the
 record's ID (which is automatically generated).  That same page then needs
 to return the record ID back so that I know what the ID is.  I will later
 allow that record's information to be populated based on the ID it first
 returned.
 
 How would I do this?
 
 Thank you, thank you!
 
 Doug Coning
 
 
 


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


Email Disclaimer

The information in this email is confidential and may be
legally privileged.
It is intended solely for the addressee.
Access to this email by anyone else is unauthorised.
If you are not the intended recipient, any disclosure,
copying, distribution
or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful.
When addressed to our clients any opinions or advice
contained in this email are subject to the terms and
conditions expressed in the governing KPMG client engagement
letter.


-- 
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: NewB: Return New Record ID...

2002-12-26 Thread Bernain, Fernando G.
It's not a bad idea to encapsulate de querys (selects, updates, inserts,...)
in SPs...

Good luck with the select max()!!!

PD: If you dont want/can use identitys, maybe you can use another table
where you store de next number of transaction. So its easy to update this
number (plus one) and make a select inmediatley to obtein the number... its
a bit strange but it works!!!

Buena suerte!!!

Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]




-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:46 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


The problem is I have hundreds of tables each with a different column list
and syntax, I don't want to have to create a SP for each table. There really
has to be an easy way to do this. Now my sql server is saying this:

Connection is busy with results for another hstmt, SQL state S1000

. it looks like I'll have to take my chances with select max() 

 Ryan

-Original Message-
From: Bernain, Fernando G. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 10:43 AM
To: Ryan Jameson (USA)
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


You can use this inside an stored procedure, for instance:

CREATE PROCEDURE SP_INSERT_TRANSACCION
@transacfecha datetime,
@observacion char(100)
 AS
INSERT INTO Transaccion(transacfecha, observacion)
VALUES(
@transacfecha,
@observacion
)
SELECT @@IDENTITY AS 'nrotrans'
END

In this example, I insert two values with this sp in a table with and
Identity column. So, the SP return the value of the transaccion generated...
You've got the idea???


Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]




-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:36 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


This doesn't work as expected through ODBC... it does not seem to return any
value...

 Ryan

-Original Message-
From: Bernain, Fernando G. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 10:09 AM
To: Ryan Jameson (USA)
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


This is from de books online (MSSQL).

@@IDENTITY (T-SQL)
Returns the last-inserted identity value. 

Syntax
@@IDENTITY

Return Types
numeric

Remarks
After an INSERT, SELECT INTO, or bulk copy statement completes, @@IDENTITY
contains the last identity value generated by the statement. If the
statement did not affect any tables with identity columns, @@IDENTITY
returns NULL. If multiple rows are inserted, generating multiple identity
values, @@IDENTITY returns the last identity value generated. If the
statement fires one or more triggers that perform inserts that generate
identity values, calling @@IDENTITY immediately after the statement returns
the last identity value generated by the triggers. The @@IDENTITY value does
not revert to a previous setting if the INSERT or SELECT INTO statement or
bulk copy fails, or if the transaction is rolled back.

Examples
This example inserts a row into a table with an identity column and uses
@@IDENTITY to display the identity value used in the new row.

INSERT INTO jobs (job_desc,min_lvl,max_lvl)

VALUES ('Accountant',12,125)

SELECT @@IDENTITY AS 'Identity'

  

Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]




-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


for MS SQL and Oracle does anyone know a more reliable way to do this than
select max(ID) immediately after the insert? It seems silly that I'd have to
take my chances that another has been inserted in between.

 Ryan

-Original Message-
From: J.Veenhuijsen [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 1:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: NewB: Return New Record ID...


Try $last=mysql_insert_id();

Jochem

Doug Coning wrote:
 Hi all,
 
 How do I do this:
 
 I need a PHP page that simply creates a blank record so that I have the
 record's ID (which is automatically generated).  That same page then needs
 to return the record ID back so that I know what the ID is.  I will later
 allow that record's information to be populated based on the ID it first
 returned.
 
 How would I do this?
 
 Thank you, thank you!
 
 Doug Coning
 
 
 


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


Email Disclaimer

The 

RE: [PHP-DB] Re: NewB: Return New Record ID...

2002-12-26 Thread Ryan Jameson (USA)
Ok, this does work through ODBC as 2 seperate queries. This seems like a safer way to 
do it.
I was trying to make it work as one insert query that returned the id. That was when I 
got the strange error message. Thanks!

 Ryan


-Original Message-
From: Bernain, Fernando G. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 10:54 AM
To: Ryan Jameson (USA)
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


It's not a bad idea to encapsulate de querys (selects, updates, inserts,...)
in SPs...

Good luck with the select max()!!!

PD: If you dont want/can use identitys, maybe you can use another table
where you store de next number of transaction. So its easy to update this
number (plus one) and make a select inmediatley to obtein the number... its
a bit strange but it works!!!

Buena suerte!!!

Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]




-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:46 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


The problem is I have hundreds of tables each with a different column list
and syntax, I don't want to have to create a SP for each table. There really
has to be an easy way to do this. Now my sql server is saying this:

Connection is busy with results for another hstmt, SQL state S1000

. it looks like I'll have to take my chances with select max() 

 Ryan

-Original Message-
From: Bernain, Fernando G. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 10:43 AM
To: Ryan Jameson (USA)
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


You can use this inside an stored procedure, for instance:

CREATE PROCEDURE SP_INSERT_TRANSACCION
@transacfecha datetime,
@observacion char(100)
 AS
INSERT INTO Transaccion(transacfecha, observacion)
VALUES(
@transacfecha,
@observacion
)
SELECT @@IDENTITY AS 'nrotrans'
END

In this example, I insert two values with this sp in a table with and
Identity column. So, the SP return the value of the transaccion generated...
You've got the idea???


Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]




-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:36 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


This doesn't work as expected through ODBC... it does not seem to return any
value...

 Ryan

-Original Message-
From: Bernain, Fernando G. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 10:09 AM
To: Ryan Jameson (USA)
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


This is from de books online (MSSQL).

@@IDENTITY (T-SQL)
Returns the last-inserted identity value. 

Syntax
@@IDENTITY

Return Types
numeric

Remarks
After an INSERT, SELECT INTO, or bulk copy statement completes, @@IDENTITY
contains the last identity value generated by the statement. If the
statement did not affect any tables with identity columns, @@IDENTITY
returns NULL. If multiple rows are inserted, generating multiple identity
values, @@IDENTITY returns the last identity value generated. If the
statement fires one or more triggers that perform inserts that generate
identity values, calling @@IDENTITY immediately after the statement returns
the last identity value generated by the triggers. The @@IDENTITY value does
not revert to a previous setting if the INSERT or SELECT INTO statement or
bulk copy fails, or if the transaction is rolled back.

Examples
This example inserts a row into a table with an identity column and uses
@@IDENTITY to display the identity value used in the new row.

INSERT INTO jobs (job_desc,min_lvl,max_lvl)

VALUES ('Accountant',12,125)

SELECT @@IDENTITY AS 'Identity'

  

Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]




-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: NewB: Return New Record ID...


for MS SQL and Oracle does anyone know a more reliable way to do this than
select max(ID) immediately after the insert? It seems silly that I'd have to
take my chances that another has been inserted in between.

 Ryan

-Original Message-
From: J.Veenhuijsen [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 1:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: NewB: Return New Record ID...


Try $last=mysql_insert_id();

Jochem

Doug Coning wrote:
 Hi all,
 
 How do I do this:
 
 I need a PHP page that simply creates a blank record so that I have the
 record's ID (which is automatically generated).  That same page then needs
 to return 

[PHP-DB] postgresql vs mysql

2002-12-26 Thread Ellen Solomon
I'm starting a project for which the lead programmer wants to use
postgresql.  I'll be working in php.  Any major disadvantages to
postgresql over mysql, other than mysql seems to be more widespread?

TIA
Ellen


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




RE: [PHP-DB] postgresql vs mysql

2002-12-26 Thread Ryan Jameson (USA)
There's a substantiated rumor that says postgres is faster for complex queries.

 Ryan

-Original Message-
From: Ellen Solomon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 12:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] postgresql vs mysql


I'm starting a project for which the lead programmer wants to use
postgresql.  I'll be working in php.  Any major disadvantages to
postgresql over mysql, other than mysql seems to be more widespread?

TIA
Ellen


-- 
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] What's wrong with my update query select works, but updatedoesn't?

2002-12-26 Thread Michael Knauf/Niles

Here's the code: with some extraneous html removed to make it easier to
read...

? require('connect.php') ?

?
/* check  for  a request to display a new fg number and if so make sure the
data is good
if the fg number is good it is used for all other data queries */
$fgNumber=;
 if  ($switchfg !==){
$switchfg = htmlentities($switchfg , ENT_QUOTES);
  if (strlen($switchfg)  7) {
  echo bad fg number;
  }
  else {
  $fgNumber =$switchfg ;
  echo $fgNumber;
}}
?


This works... I added the echo statement in the last line for debugging
purposes, the page does indeed display the fgNumber, and uses the variable
to perform other queries, which also work... until I try to update the
database


?

if ($tableid==products) {
echo updating products;
  if ($productName !=  and  $productDescription !=) {
  $products_query= UPDATE products SET productName='$productName',
productDescription='$productDescription' where fgNumber='$fgNumber' limit
1;
  $productsResult = mysql_query($products_query);
  echo $products_query;
  }
}
?

Again, that last line is a debugging entry, and it echoes back the query
I'm expecting, except that the variable $fgNumber looses it's value
somewhere and the query looks like this:

UPDATE products SET productName='ZR-4630 MultiZone Receiver',
productDescription='4-Source 6-Zone Receiver with AM/FM Tuner' where
fgNumber='' limit 1

I expect it to say  where fgNumber='FG00813

Here's the form that triggers the update


!-- __ PRODUCTS TABLE
__ --
?
$productsQuery =SELECT id, fgNumber, productName, productDescription FROM
products where fgNumber='$fgNumber' ;
$productsRecordset = mysql_query($productsQuery) or die(mysql_error());
$productsRow=mysql_fetch_array($productsRecordset);
//$fgNumber=$productsRow['fgNumber']
?
form name=products method=post action=? $_SERVER['php_self']
?input name=tableid type=hidden value=products
table width=100% border=0 cellpadding=10 cellspacing=0 bgcolor=
#CC
tr
td colspan=4h2Products Table/h2
hr
/td
/tr
tr
tdID:
input name=productId type=text id=productId
value=? echo $productsRow['id'] ? size=5/td
tdFG#:
input name=fgNumber type=text id
=fgNumber value=? echo $productsRow['fgNumber'] ? size=10/td
tdName:
input name=productName type=text
id=productName value=? echo $productsRow['productName'] ? size
=36/td
tdDescription
input name=productDescription type
=text id=productDescription value=? echo $productsRow
['productDescription'] ? size=48/td
/tr
tr
td colspan=4Update Product Information
input type=submit name=Submit value
=Submit/td
/tr
/table
/form

I keep looking for an error and not finding one, am I missing something
obvious?

Michael




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




RE: [PHP-DB] postgresql vs mysql

2002-12-26 Thread David Bryant
I've worked with both extensively. My personal preference is PG.
However, here are my findings over the years.

The biggest factor in performance is the size of the database, more than
anything else. If you have a small and relatively simple RDB structure,
MySQL is significantly faster. (this is changing however. PG has made
some significant improvements in speed this last year, but MySQL is
improving performance considerably with larger and more complex RDBs.)

PG has a much flatter performance line regardless of db size, whereas
MySQL just gets much slower and slower as the db MB increases.

-D 
AdPak Communications, Inc.
Network Security Products, Sales  Support
(623) 936-4800 * Toll Free 1-888-600-7066 * Fax: (623) 936-4111
Who Is Watching Your Network?
Corporate/Sales/Service: www.adpak.com
 
-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 26, 2002 1:18 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] postgresql vs mysql


There's a substantiated rumor that says postgres is faster for complex
queries.

 Ryan

-Original Message-
From: Ellen Solomon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 12:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] postgresql vs mysql


I'm starting a project for which the lead programmer wants to use
postgresql.  I'll be working in php.  Any major disadvantages to
postgresql over mysql, other than mysql seems to be more widespread?

TIA
Ellen


-- 
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] What's wrong with my update query select works, but update doesn't?

2002-12-26 Thread Ryan Jameson (USA)
Well, it seems to me that if these two happen within the same scope level (same 
function, same class) which I cannot verify based on what you gave us, the $fgNumber 
should not be empty. Therefore I'd bet there's some code in between that reinitializes 
$fgNumber or the update is in a function that does not have access to the $fgNumber. 
You can give a function access to that variable by declaring it global inside of the 
function, or passing it as a variable.

 Ryan

-Original Message-
From: Michael Knauf/Niles [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 1:41 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] What's wrong with my update query select works,
but update doesn't?



Here's the code: with some extraneous html removed to make it easier to
read...

? require('connect.php') ?

?
/* check  for  a request to display a new fg number and if so make sure the
data is good
if the fg number is good it is used for all other data queries */
$fgNumber=;
 if  ($switchfg !==){
$switchfg = htmlentities($switchfg , ENT_QUOTES);
  if (strlen($switchfg)  7) {
  echo bad fg number;
  }
  else {
  $fgNumber =$switchfg ;
  echo $fgNumber;
}}
?


This works... I added the echo statement in the last line for debugging
purposes, the page does indeed display the fgNumber, and uses the variable
to perform other queries, which also work... until I try to update the
database


?

if ($tableid==products) {
echo updating products;
  if ($productName !=  and  $productDescription !=) {
  $products_query= UPDATE products SET productName='$productName',
productDescription='$productDescription' where fgNumber='$fgNumber' limit
1;
  $productsResult = mysql_query($products_query);
  echo $products_query;
  }
}
?

Again, that last line is a debugging entry, and it echoes back the query
I'm expecting, except that the variable $fgNumber looses it's value
somewhere and the query looks like this:

UPDATE products SET productName='ZR-4630 MultiZone Receiver',
productDescription='4-Source 6-Zone Receiver with AM/FM Tuner' where
fgNumber='' limit 1

I expect it to say  where fgNumber='FG00813

Here's the form that triggers the update


!-- __ PRODUCTS TABLE
__ --
?
$productsQuery =SELECT id, fgNumber, productName, productDescription FROM
products where fgNumber='$fgNumber' ;
$productsRecordset = mysql_query($productsQuery) or die(mysql_error());
$productsRow=mysql_fetch_array($productsRecordset);
//$fgNumber=$productsRow['fgNumber']
?
form name=products method=post action=? $_SERVER['php_self']
?input name=tableid type=hidden value=products
table width=100% border=0 cellpadding=10 cellspacing=0 bgcolor=
#CC
tr
td colspan=4h2Products Table/h2
hr
/td
/tr
tr
tdID:
input name=productId type=text id=productId
value=? echo $productsRow['id'] ? size=5/td
tdFG#:
input name=fgNumber type=text id
=fgNumber value=? echo $productsRow['fgNumber'] ? size=10/td
tdName:
input name=productName type=text
id=productName value=? echo $productsRow['productName'] ? size
=36/td
tdDescription
input name=productDescription type
=text id=productDescription value=? echo $productsRow
['productDescription'] ? size=48/td
/tr
tr
td colspan=4Update Product Information
input type=submit name=Submit value
=Submit/td
/tr
/table
/form

I keep looking for an error and not finding one, am I missing something
obvious?

Michael




-- 
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] Help Needed

2002-12-26 Thread Rick Widmer
At 02:36 PM 12/26/02 +0700, dufronte wrote:


Hi.
I juz installed a RedHat 8.0 on my machine.
But then I have a problem in configuring Apache 2.0.4 to use PHP 4.20..


Apache 2 and PHP are not ready for prime time.  If you must use Apache 2 
with PHP, you are on the bleeding edge, and should plan on helping debug 
the combination.

Certainly there are some combinations of versions and configurations that 
do work, but there are many, many more that do not.  If you have time to 
study and test Apache 2 + PHP, I'm sure your help would be welcome.

If you want it to just work, you should be using Apache 1.3.


Rick


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



RE: [PHP-DB] Help Needed

2002-12-26 Thread dufronte
I juz solved my problems last night...
When I searched PHP.net.. I found out that PHP.4.3.ORC4 is compatible
for APACHE2 but it isn't released yet... When I installed it.. it
works... now I can use PHP in my APACHE2...

Juz for information for somebody who have the same problem like me, you
can use the PHP.4.3.ORC4 for APACHE2.. it's more stable.. I guarantee...

Download : http://qa.php.net 


--www.kapsul.org--
  DuFronte

-Original Message-
From: Rick Widmer [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 27, 2002 8:18 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Help Needed

At 02:36 PM 12/26/02 +0700, dufronte wrote:

Hi.
I juz installed a RedHat 8.0 on my machine.
But then I have a problem in configuring Apache 2.0.4 to use PHP 4.20..

Apache 2 and PHP are not ready for prime time.  If you must use Apache 2

with PHP, you are on the bleeding edge, and should plan on helping debug

the combination.

Certainly there are some combinations of versions and configurations
that 
do work, but there are many, many more that do not.  If you have time to

study and test Apache 2 + PHP, I'm sure your help would be welcome.

If you want it to just work, you should be using Apache 1.3.


Rick




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




[PHP-DB] how to call a stored procedure in SQL Server 2000

2002-12-26 Thread Ha Duy Thien
Hi gurus,

I am new user to PHP.

Does anyone here work with SQL server with PHP, please show me some codes about how to 
call a stored procedure in a SQL Server Database. 

how to add paramaters also

Thanks a lot

Thien


[PHP-DB] how to call a stored procedure in SQL Server 2000

2002-12-26 Thread thien
Hi gurus,

I am new user to PHP.

Does anyone here work with SQL server with PHP, please show me some codes
about how to call a stored procedure in a SQL Server Database.

how to add paramaters also

Thanks a lot

Thien



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




Re: [PHP-DB] how to call a stored procedure in SQLServer 2000

2002-12-26 Thread Frank M. Kromann
Take a look at the documentation:

http://www.php.net/manual/en/function.mssql-execute.php

- Frank

 Hi gurus,
 
 I am new user to PHP.
 
 Does anyone here work with SQL server with PHP, please show me some
codes about how to call a stored procedure in a SQL Server Database. 
 
 how to add paramaters also
 
 Thanks a lot
 
 Thien




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