php-windows Digest 28 Jun 2003 10:55:19 -0000 Issue 1799

Topics (messages 20604 through 20611):

Re: or die problem
        20604 by: Cristian MARIN
        20605 by: Shaffin Bhanji
        20606 by: Croskerry, Dan
        20607 by: Stephen
        20608 by: Charles P. Killmer
        20609 by: Stephen

Re: Phpinfo.php
        20610 by: Jeff Stewart

Win32 PHP5 + Apache1.3.27 = Internal Server Error
        20611 by: Nakano

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
Try echo mysql_query($your_query_here), because if returns false it will
die.
To figure out why it return false see how many_rows were affected with
mysql_affected_rows();

-- 
-------------------------------------------------
Cristian MARIN - Developer
InterAKT Online (www.interakt.ro)
Tel:         +4021 312.53.12
Tel/Fax:  +4021 312.51.91
[EMAIL PROTECTED]
"Dan Croskerry" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> There is no error message. It happens mostly when I am doing an update or
> insert statement. There is no problem with the sql because the data gets
> written to the db. If I use or die it still writes to the db but the or
die
> kills the processing. It's strange.
>
> -----Original Message-----
> From: Cristian MARIN [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 27, 2003 10:18 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Re: or die problem
>
>
> Maybe not the query is the problem, maybe the connection or the
> authentication ... Try executing the sql without the die part and then
print
> out the
> mysql_error() if the mysql_errno()!=0
>
> mysql_query($your_query_here);
> if (mysql_errno()!=0){
>     die (mysql_error());
> }
>
>
> -- 
> -------------------------------------------------
> Cristian MARIN - Developer
> InterAKT Online (www.interakt.ro)
> Tel:         +4021 312.53.12
> Tel/Fax:  +4021 312.51.91
> [EMAIL PROTECTED]
> "Dan Croskerry" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I'm new to the windows platform for php development and I have been
> > having problems with the or die function when running sql queries. It
> > is being called even when I run a valid query. I have tested it with
> > valid queries and it is always triggered. I have had to stop using it
> > which is not good.
> I
> > never had problems with or die when I was working in a linux
> > environment.
> >
> > Does anyone know if there is a setting in the php.ini file that I have
> > to set for or die to work? My DB is MS SQL 2000.
> >
> > Thanks in advance,
> > Dan
> >
>
>
>
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



--- End Message ---
--- Begin Message ---
It might help if you can post your code snippet!

>>> "Croskerry, Dan" <[EMAIL PROTECTED]> 27/06/2003 12:28:13 pm >>>
There is no error message. It happens mostly when I am doing an update
or
insert statement. There is no problem with the sql because the data
gets
written to the db. If I use or die it still writes to the db but the or
die
kills the processing. It's strange.

-----Original Message-----
From: Cristian MARIN [ mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 10:18 PM
To: [EMAIL PROTECTED] 
Subject: [PHP-WIN] Re: or die problem


Maybe not the query is the problem, maybe the connection or the
authentication ... Try executing the sql without the die part and then
print
out the
mysql_error() if the mysql_errno()!=0

mysql_query($your_query_here);
if (mysql_errno()!=0){
die (mysql_error());
}


-- 
-------------------------------------------------
Cristian MARIN - Developer
InterAKT Online ( www.interakt.ro )
Tel: +4021 312.53.12
Tel/Fax: +4021 312.51.91
[EMAIL PROTECTED] 
"Dan Croskerry" < [EMAIL PROTECTED] > wrote in message
news:[EMAIL PROTECTED] ...
> I'm new to the windows platform for php development and I have been 
> having problems with the or die function when running sql queries. It

> is being called even when I run a valid query. I have tested it with

> valid queries and it is always triggered. I have had to stop using it

> which is not good.
I
> never had problems with or die when I was working in a linux 
> environment.
>
> Does anyone know if there is a setting in the php.ini file that I
have 
> to set for or die to work? My DB is MS SQL 2000.
>
> Thanks in advance,
> Dan
>



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


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


--- End Message ---
--- Begin Message ---
It's a straight forward update statement. Like I said, it works, the data is
written to the DB even with the or die so I'm not sure why the die is
invoked. 
 
$sql = "UPDATE Helpline SET morn_pers='".$FV['morn_pers']."',
aft_pers='".$FV['aft_pers']."', eve_pers='".$FV['eve_pers']."', ";
$sql .= " notes='".$FV['notes']."' WHERE help_date='".$FV['insertDate']."'
";
$result = mssql_query($sql); // or die ("insert failed")

-----Original Message-----
From: Shaffin Bhanji [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 12:39 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Re: or die problem


It might help if you can post your code snippet!

>>> "Croskerry, Dan" <[EMAIL PROTECTED]> 27/06/2003 12:28:13 pm >>>
There is no error message. It happens mostly when I am doing an update or
insert statement. There is no problem with the sql because the data gets
written to the db. If I use or die it still writes to the db but the or die
kills the processing. It's strange.

-----Original Message-----
From: Cristian MARIN [ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>  
Sent: Friday, June 27, 2003 10:18 PM
To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  
Subject: [PHP-WIN] Re: or die problem


Maybe not the query is the problem, maybe the connection or the
authentication ... Try executing the sql without the die part and then print
out the
mysql_error() if the mysql_errno()!=0

mysql_query($your_query_here);
if (mysql_errno()!=0){
die (mysql_error());
}


-- 
-------------------------------------------------
Cristian MARIN - Developer
InterAKT Online ( www.interakt.ro <http://www.interakt.ro>  )
Tel: +4021 312.53.12
Tel/Fax: +4021 312.51.91
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  
"Dan Croskerry" < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  > wrote in
message
news:[EMAIL PROTECTED]
<mailto:news:[EMAIL PROTECTED]>
...
> I'm new to the windows platform for php development and I have been 
> having problems with the or die function when running sql queries. It 
> is being called even when I run a valid query. I have tested it with 
> valid queries and it is always triggered. I have had to stop using it 
> which is not good.
I
> never had problems with or die when I was working in a linux 
> environment.
>
> Does anyone know if there is a setting in the php.ini file that I have 
> to set for or die to work? My DB is MS SQL 2000.
>
> Thanks in advance,
> Dan
>



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


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




--- End Message ---
--- Begin Message ---
Dan,

mssql_query($sql); // or die ("insert failed")

When you use or die, you must NOT have a ; on the end of the mssql_query
eg

mssql_query( $MyQuery )
OR die( 'Error' );

Notice the ; only goes on to the end of the or die command.

Stephen

----- Original Message ----- 
From: "Croskerry, Dan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 27, 2003 5:43 PM
Subject: RE: [PHP-WIN] Re: or die problem


> It's a straight forward update statement. Like I said, it works, the data
is
> written to the DB even with the or die so I'm not sure why the die is
> invoked.
>
> $sql = "UPDATE Helpline SET morn_pers='".$FV['morn_pers']."',
> aft_pers='".$FV['aft_pers']."', eve_pers='".$FV['eve_pers']."', ";
> $sql .= " notes='".$FV['notes']."' WHERE help_date='".$FV['insertDate']."'
> ";
> $result = mssql_query($sql); // or die ("insert failed")
>
> -----Original Message-----
> From: Shaffin Bhanji [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 27, 2003 12:39 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] Re: or die problem
>
>
> It might help if you can post your code snippet!
>
> >>> "Croskerry, Dan" <[EMAIL PROTECTED]> 27/06/2003 12:28:13 pm >>>
> There is no error message. It happens mostly when I am doing an update or
> insert statement. There is no problem with the sql because the data gets
> written to the db. If I use or die it still writes to the db but the or
die
> kills the processing. It's strange.
>
> -----Original Message-----
> From: Cristian MARIN [ mailto:[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> Sent: Friday, June 27, 2003 10:18 PM
> To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> Subject: [PHP-WIN] Re: or die problem
>
>
> Maybe not the query is the problem, maybe the connection or the
> authentication ... Try executing the sql without the die part and then
print
> out the
> mysql_error() if the mysql_errno()!=0
>
> mysql_query($your_query_here);
> if (mysql_errno()!=0){
> die (mysql_error());
> }
>
>
> -- 
> -------------------------------------------------
> Cristian MARIN - Developer
> InterAKT Online ( www.interakt.ro <http://www.interakt.ro>  )
> Tel: +4021 312.53.12
> Tel/Fax: +4021 312.51.91
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> "Dan Croskerry" < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  > wrote in
> message
> news:[EMAIL PROTECTED]
> <mailto:news:[EMAIL PROTECTED]>
> ...
> > I'm new to the windows platform for php development and I have been
> > having problems with the or die function when running sql queries. It
> > is being called even when I run a valid query. I have tested it with
> > valid queries and it is always triggered. I have had to stop using it
> > which is not good.
> I
> > never had problems with or die when I was working in a linux
> > environment.
> >
> > Does anyone know if there is a setting in the php.ini file that I have
> > to set for or die to work? My DB is MS SQL 2000.
> >
> > Thanks in advance,
> > Dan
> >
>
>
>
> -- 
> PHP Windows Mailing List ( http://www.php.net/ <http://www.php.net/>  )
> To unsubscribe, visit: http://www.php.net/unsub.php
> <http://www.php.net/unsub.php>
>
>
> -- 
> PHP Windows Mailing List ( http://www.php.net/ <http://www.php.net/>  )
> To unsubscribe, visit: http://www.php.net/unsub.php
> <http://www.php.net/unsub.php>
>
>
>
>



--- End Message ---
--- Begin Message ---
If you notice he has it commented out.  I doubt that that was the
problem.  

I read somewhere a while ago about a difference in operator precedence
between || and or.  

Perhaps the die is being invooked first?

Charles Killmer

-----Original Message-----
From: Stephen [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 12:01 PM
To: Croskerry, Dan
Cc: Windows Helplist (PHP)
Subject: Re: [PHP-WIN] Re: or die problem


Dan,

mssql_query($sql); // or die ("insert failed")

When you use or die, you must NOT have a ; on the end of the mssql_query
eg

mssql_query( $MyQuery )
OR die( 'Error' );

Notice the ; only goes on to the end of the or die command.

Stephen

----- Original Message ----- 
From: "Croskerry, Dan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 27, 2003 5:43 PM
Subject: RE: [PHP-WIN] Re: or die problem


> It's a straight forward update statement. Like I said, it works, the 
> data
is
> written to the DB even with the or die so I'm not sure why the die is 
> invoked.
>
> $sql = "UPDATE Helpline SET morn_pers='".$FV['morn_pers']."', 
> aft_pers='".$FV['aft_pers']."', eve_pers='".$FV['eve_pers']."', "; 
> $sql .= " notes='".$FV['notes']."' WHERE 
> help_date='".$FV['insertDate']."' "; $result = mssql_query($sql); // 
> or die ("insert failed")
>
> -----Original Message-----
> From: Shaffin Bhanji [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 27, 2003 12:39 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] Re: or die problem
>
>
> It might help if you can post your code snippet!
>
> >>> "Croskerry, Dan" <[EMAIL PROTECTED]> 27/06/2003 12:28:13 pm >>>
> There is no error message. It happens mostly when I am doing an update

> or insert statement. There is no problem with the sql because the data

> gets written to the db. If I use or die it still writes to the db but 
> the or
die
> kills the processing. It's strange.
>
> -----Original Message-----
> From: Cristian MARIN [ mailto:[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>
> Sent: Friday, June 27, 2003 10:18 PM
> To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> Subject: [PHP-WIN] Re: or die problem
>
>
> Maybe not the query is the problem, maybe the connection or the 
> authentication ... Try executing the sql without the die part and then
print
> out the
> mysql_error() if the mysql_errno()!=0
>
> mysql_query($your_query_here);
> if (mysql_errno()!=0){
> die (mysql_error());
> }
>
>
> --
> -------------------------------------------------
> Cristian MARIN - Developer
> InterAKT Online ( www.interakt.ro <http://www.interakt.ro>  )
> Tel: +4021 312.53.12
> Tel/Fax: +4021 312.51.91
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> "Dan Croskerry" < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  > wrote in
> message
> news:[EMAIL PROTECTED]
>
<mailto:news:[EMAIL PROTECTED]
>
> ...
> > I'm new to the windows platform for php development and I have been 
> > having problems with the or die function when running sql queries. 
> > It is being called even when I run a valid query. I have tested it 
> > with valid queries and it is always triggered. I have had to stop 
> > using it which is not good.
> I
> > never had problems with or die when I was working in a linux 
> > environment.
> >
> > Does anyone know if there is a setting in the php.ini file that I 
> > have to set for or die to work? My DB is MS SQL 2000.
> >
> > Thanks in advance,
> > Dan
> >
>
>
>
> --
> PHP Windows Mailing List ( http://www.php.net/ <http://www.php.net/>
)
> To unsubscribe, visit: http://www.php.net/unsub.php
> <http://www.php.net/unsub.php>
>
>
> --
> PHP Windows Mailing List ( http://www.php.net/ <http://www.php.net/>
)
> To unsubscribe, visit: http://www.php.net/unsub.php
> <http://www.php.net/unsub.php>
>
>
>
>



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


--- End Message ---
--- Begin Message ---
No, it is exactly the problem. || is only used in evaluation statements such
as if, while, etc etc. Or is used when something must return a value to
work, Or if it returns false (nothing), then to do the other section.

"Do This Query and Return True / a value"
OR "Do this if the query returns false";

Stephen

----- Original Message ----- 
From: "Charles P. Killmer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 27, 2003 6:10 PM
Subject: RE: [PHP-WIN] Re: or die problem


If you notice he has it commented out.  I doubt that that was the
problem.

I read somewhere a while ago about a difference in operator precedence
between || and or.

Perhaps the die is being invooked first?

Charles Killmer

-----Original Message-----
From: Stephen [mailto:[EMAIL PROTECTED]
Sent: Friday, June 27, 2003 12:01 PM
To: Croskerry, Dan
Cc: Windows Helplist (PHP)
Subject: Re: [PHP-WIN] Re: or die problem


Dan,

mssql_query($sql); // or die ("insert failed")

When you use or die, you must NOT have a ; on the end of the mssql_query
eg

mssql_query( $MyQuery )
OR die( 'Error' );

Notice the ; only goes on to the end of the or die command.

Stephen

----- Original Message ----- 
From: "Croskerry, Dan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 27, 2003 5:43 PM
Subject: RE: [PHP-WIN] Re: or die problem


> It's a straight forward update statement. Like I said, it works, the
> data
is
> written to the DB even with the or die so I'm not sure why the die is
> invoked.
>
> $sql = "UPDATE Helpline SET morn_pers='".$FV['morn_pers']."',
> aft_pers='".$FV['aft_pers']."', eve_pers='".$FV['eve_pers']."', ";
> $sql .= " notes='".$FV['notes']."' WHERE
> help_date='".$FV['insertDate']."' "; $result = mssql_query($sql); //
> or die ("insert failed")
>
> -----Original Message-----
> From: Shaffin Bhanji [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 27, 2003 12:39 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] Re: or die problem
>
>
> It might help if you can post your code snippet!
>
> >>> "Croskerry, Dan" <[EMAIL PROTECTED]> 27/06/2003 12:28:13 pm >>>
> There is no error message. It happens mostly when I am doing an update

> or insert statement. There is no problem with the sql because the data

> gets written to the db. If I use or die it still writes to the db but
> the or
die
> kills the processing. It's strange.
>
> -----Original Message-----
> From: Cristian MARIN [ mailto:[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> Sent: Friday, June 27, 2003 10:18 PM
> To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> Subject: [PHP-WIN] Re: or die problem
>
>
> Maybe not the query is the problem, maybe the connection or the
> authentication ... Try executing the sql without the die part and then
print
> out the
> mysql_error() if the mysql_errno()!=0
>
> mysql_query($your_query_here);
> if (mysql_errno()!=0){
> die (mysql_error());
> }
>
>
> --
> -------------------------------------------------
> Cristian MARIN - Developer
> InterAKT Online ( www.interakt.ro <http://www.interakt.ro>  )
> Tel: +4021 312.53.12
> Tel/Fax: +4021 312.51.91
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> "Dan Croskerry" < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  > wrote in
> message
> news:[EMAIL PROTECTED]
>
<mailto:news:[EMAIL PROTECTED]
>
> ...
> > I'm new to the windows platform for php development and I have been
> > having problems with the or die function when running sql queries.
> > It is being called even when I run a valid query. I have tested it
> > with valid queries and it is always triggered. I have had to stop
> > using it which is not good.
> I
> > never had problems with or die when I was working in a linux
> > environment.
> >
> > Does anyone know if there is a setting in the php.ini file that I
> > have to set for or die to work? My DB is MS SQL 2000.
> >
> > Thanks in advance,
> > Dan
> >
>
>
>
> --
> PHP Windows Mailing List ( http://www.php.net/ <http://www.php.net/>
)
> To unsubscribe, visit: http://www.php.net/unsub.php
> <http://www.php.net/unsub.php>
>
>
> --
> PHP Windows Mailing List ( http://www.php.net/ <http://www.php.net/>
)
> To unsubscribe, visit: http://www.php.net/unsub.php
> <http://www.php.net/unsub.php>
>
>
>
>



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


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




--- End Message ---
--- Begin Message ---
Try <?php phpinfo(); ?> instead.

--
Jeff S.


"Mathias" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I use Microsoft Windows XP Pro, and PHP4. Im reading the book Sams teach
> yourself PHP, Mysql and Apache.
> I setup mysql apache2 and php4. I cannot get <? phpinfo(); ?> to work. Can
> anyone HELP PLEASE?!?!???
>
>



--- End Message ---
--- Begin Message ---
Hello there, everyone.

Just wanted to try out PHP5 snapshot (php5-win32-200306212230) under Windows
XP and Apache keeps giving me "Premature end of script headers" error,
either on a simple HelloWorld type code or a phpinfo() code.

I searched the web and seems like many have had this problem as well, but no
concrete solution was found. I did all that (supposedly) should be edited on
document_root.

php.exe keeps giving those annoying errors, but if I switch everything back
to 4.3.2 works just fine.

Any ideas? TIA



--- End Message ---

Reply via email to