php-windows Digest 16 Sep 2005 16:44:23 -0000 Issue 2775
Topics (messages 26333 through 26349):
Re: MSIE problems
26333 by: Bob Stout
26336 by: M. Sokolewicz
26337 by: M. Sokolewicz
26341 by: Luis Ferro
Re: Calling MSSQL Stored Procedure
26334 by: Mark Rees
26335 by: Alf Stockton
26338 by: Mark Rees
26339 by: Alf Stockton
26340 by: Mark Rees
26342 by: M. Sokolewicz
26343 by: M. Sokolewicz
26344 by: Alf Stockton
26345 by: Mark Rees
26346 by: Alf Stockton
26347 by: Alf Stockton
26348 by: Mark Rees
26349 by: Kevin Smith
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 ---
Bob Stout wrote:
Although it works fine with Firefox, whenever I use a <select> object
to open a PHP file in a frame, with an internal reference, it ignores
the reference. IOW, if the link I want in the frame is "somefile.php",
everything works OK. If, instead, the link I want in the frame is
"somefile.php#here", it displays the file from the beginning, ignoring
the reference to the <name="here"> tag.
Has anyone experienced this before and, if so, is there a work-around
for it?
I should have added that it works just fine if the link is an HTML file.
As in the example above, linking "somefile.htm#here" or
"somefile.html#here" to a frame both work just fine. I also displayed
the source that MSIE is seeing, and the reference appears correctly in
the HTML. The problem apparently is that it doesn't recognize PHP files
as a valid HTML file type.
--
Bob Stout <[EMAIL PROTECTED]> - The rules of life:
"Either lead, follow, or get out of the way."
"It's easier to get forgiveness than permission."
"90% of everything is garbage."
"Never attribute to malice what can be adequately explained by
stupidity."
--- End Message ---
--- Begin Message ---
Bob Stout wrote:
Bob Stout wrote:
Although it works fine with Firefox, whenever I use a <select> object
to open a PHP file in a frame, with an internal reference, it ignores
the reference. IOW, if the link I want in the frame is "somefile.php",
everything works OK. If, instead, the link I want in the frame is
"somefile.php#here", it displays the file from the beginning, ignoring
the reference to the <name="here"> tag.
Has anyone experienced this before and, if so, is there a work-around
for it?
I should have added that it works just fine if the link is an HTML file.
As in the example above, linking "somefile.htm#here" or
"somefile.html#here" to a frame both work just fine. I also displayed
the source that MSIE is seeing, and the reference appears correctly in
the HTML. The problem apparently is that it doesn't recognize PHP files
as a valid HTML file type.
this is obiously a browser problem. You can't do anything about it from
the PHP side of it (since it has nothing to do with it). If you want to
fix this, "fix" your MS browser... sorry, but that's the best you'll get
here..
--- End Message ---
--- Begin Message ---
Bob Stout wrote:
Bob Stout wrote:
Although it works fine with Firefox, whenever I use a <select> object
to open a PHP file in a frame, with an internal reference, it ignores
the reference. IOW, if the link I want in the frame is "somefile.php",
everything works OK. If, instead, the link I want in the frame is
"somefile.php#here", it displays the file from the beginning, ignoring
the reference to the <name="here"> tag.
Has anyone experienced this before and, if so, is there a work-around
for it?
I should have added that it works just fine if the link is an HTML file.
As in the example above, linking "somefile.htm#here" or
"somefile.html#here" to a frame both work just fine. I also displayed
the source that MSIE is seeing, and the reference appears correctly in
the HTML. The problem apparently is that it doesn't recognize PHP files
as a valid HTML file type.
this is obiously a browser problem. You can't do anything about it from
the PHP side of it (since it has nothing to do with it). If you want to
fix this, "fix" your MS browser... sorry, but that's the best you'll get
here..
--- End Message ---
--- Begin Message ---
Instead of doing a somefile.php#ref do a somefile.php?jump=ref and then
in the somefile.php add a mix of javascript/php to perform the "jump"...
That is a workaround and should work in any browser that uses javascript.
Of course, if javascript is turned off the user is always stuck to the
top of the document, which isn't a too bad degradation of
funcionality... (specially if the top of the document has links for it's
targets).
Cheers,
LF
M. Sokolewicz wrote:
Bob Stout wrote:
Bob Stout wrote:
Although it works fine with Firefox, whenever I use a <select>
object to open a PHP file in a frame, with an internal reference, it
ignores the reference. IOW, if the link I want in the frame is
"somefile.php", everything works OK. If, instead, the link I want in
the frame is "somefile.php#here", it displays the file from the
beginning, ignoring the reference to the <name="here"> tag.
Has anyone experienced this before and, if so, is there a
work-around for it?
I should have added that it works just fine if the link is an HTML
file. As in the example above, linking "somefile.htm#here" or
"somefile.html#here" to a frame both work just fine. I also displayed
the source that MSIE is seeing, and the reference appears correctly
in the HTML. The problem apparently is that it doesn't recognize PHP
files as a valid HTML file type.
this is obiously a browser problem. You can't do anything about it
from the PHP side of it (since it has nothing to do with it). If you
want to fix this, "fix" your MS browser... sorry, but that's the best
you'll get here..
--- End Message ---
--- Begin Message ---
> I have to access a MsSQL stored procedure coded as follows :-
>
> CREATE PROCEDURE spGetActivePromotions
> @Today datetime
> AS
> SELECT PromotionID, PromotionName, StartDate, EndDate, LastDrawDate,
> MaxDraws, NumRegTickets, VouchersPermitted, NumTicketsPerVoucher,
> ManualTicketIssue
> FROM Promotion
> WHERE @Today>=StartDate AND @Today<=EndDate
> GO
>
> and therefore have coded my php as follows :-
>
> $PMdriver = "mssql";
> $PMdb = ADONewConnection($PMdriver);
> $PMdb->Connect($PMserver, $PMuser, $PMpassword, $PMdatabase);
> $SQL = $PMdb->Prepare("spGetActivePromotions");
> $ActualDate = strftime("%Y/%m/%d %I:%m:%S %p");
what does echo $ActualDate give you?
> $PMdb->InParameter($SQL, $ActualDate, "Today");
> $PMdb->OutParameter($SQL, $ret, 'RETVAL');
>
> but I keep getting the error message
> 201: Procedure 'spGetActivePromotions' expects parameter '@Today', which
> was not supplied.
--- End Message ---
--- Begin Message ---
Mark Rees wrote:
I have to access a MsSQL stored procedure coded as follows :-
CREATE PROCEDURE spGetActivePromotions
@Today datetime
AS
SELECT PromotionID, PromotionName, StartDate, EndDate, LastDrawDate,
MaxDraws, NumRegTickets, VouchersPermitted, NumTicketsPerVoucher,
ManualTicketIssue
FROM Promotion
WHERE @Today>=StartDate AND @Today<=EndDate
GO
and therefore have coded my php as follows :-
$PMdriver = "mssql";
$PMdb = ADONewConnection($PMdriver);
$PMdb->Connect($PMserver, $PMuser, $PMpassword, $PMdatabase);
$SQL = $PMdb->Prepare("spGetActivePromotions");
$ActualDate = strftime("%Y/%m/%d %I:%m:%S %p");
what does echo $ActualDate give you?
I get 2005/09/16 10:09:22 AM which is exactly the same format as it
appears in the database table when viewed via Enterprise Manager.
--
Regards,
Alf Stockton www.stockton.co.za
Today is what happened to yesterday.
My email disclaimer is available at www.stockton.co.za/disclaimer.html
--- End Message ---
--- Begin Message ---
>
> >>I have to access a MsSQL stored procedure coded as follows :-
> >>
> >>CREATE PROCEDURE spGetActivePromotions
> >> @Today datetime
> >>AS
> >>SELECT PromotionID, PromotionName, StartDate, EndDate, LastDrawDate,
> >> MaxDraws, NumRegTickets, VouchersPermitted, NumTicketsPerVoucher,
> >>ManualTicketIssue
> >> FROM Promotion
> >> WHERE @Today>=StartDate AND @Today<=EndDate
> >>GO
> >>
> >>and therefore have coded my php as follows :-
> >>
> >> $PMdriver = "mssql";
> >> $PMdb = ADONewConnection($PMdriver);
> >> $PMdb->Connect($PMserver, $PMuser, $PMpassword, $PMdatabase);
> >> $SQL = $PMdb->Prepare("spGetActivePromotions");
> >> $ActualDate = strftime("%Y/%m/%d %I:%m:%S %p");
> >>
> >>
> >
> >what does echo $ActualDate give you?
> >
> >
> >
> I get 2005/09/16 10:09:22 AM which is exactly the same format as it
> appears in the database table when viewed via Enterprise Manager.
I wouldn't set too much store by how it looks in EM. It is a datetime value,
so its internal representation will be quite different.
It seems likely that $actualdate isn't actually a datetime by the time it
gets to the database, for whatever reason.
Note this line from the adodb docs: (I am presuming you are using ADODB for
PHP here)
If $type parameter is set to false, in mssql, $type will be dynamicly
determined based on the type of the PHP variable passed (string => SQLCHAR,
boolean =>SQLINT1, integer =>SQLINT4 or float/double=>SQLFLT8).
http://phplens.com/lens/adodb/docs-adodb.htm
I would look into supplying the data type when adding the parameter
Hope this helps
Mark
--- End Message ---
--- Begin Message ---
Mark Rees wrote:
I get 2005/09/16 10:09:22 AM which is exactly the same format as it
appears in the database table when viewed via Enterprise Manager.
I wouldn't set too much store by how it looks in EM. It is a datetime value,
so its internal representation will be quite different.
It seems likely that $actualdate isn't actually a datetime by the time it
gets to the database, for whatever reason.
Note this line from the adodb docs: (I am presuming you are using ADODB for
PHP here)
If $type parameter is set to false, in mssql, $type will be dynamicly
determined based on the type of the PHP variable passed (string => SQLCHAR,
boolean =>SQLINT1, integer =>SQLINT4 or float/double=>SQLFLT8).
http://phplens.com/lens/adodb/docs-adodb.htm
I would look into supplying the data type when adding the parameter
Please suggest what data type you would use. In the database the
requisit field is a datetime but I cannot find in either adodb or php
document a datetime type.
A little further down in the manual you refer to above it says interalia:-
[$*type*] Consult mssql_bind <http://php.net/mssql_bind> and
ocibindbyname <http://php.net/ocibindbyname> docs at php.net for more
info on legal values for type.
and neither mssql_bind <http://php.net/mssql_bind> nor ocibindbyname
<http://php.net/ocibindbyname> led me to a list of types but looking at
GetType gave me the following list?????
*
"*boolean*
<http://www.php.net/manual/en/language.types.boolean.php>" (since
PHP 4)
*
"*integer* <http://www.php.net/manual/en/language.types.integer.php>"
*
"*double* <http://www.php.net/manual/en/language.types.float.php>"
(for historical reasons "double" is returned in case of a *float*
<http://www.php.net/manual/en/language.types.float.php>, and not
simply "float")
*
"*string* <http://www.php.net/manual/en/language.types.string.php>"
*
"*array* <http://www.php.net/manual/en/language.types.array.php>"
*
"*object* <http://www.php.net/manual/en/language.types.object.php>"
*
"*resource*
<http://www.php.net/manual/en/language.types.resource.php>" (since
PHP 4)
*
"*NULL* <http://www.php.net/manual/en/language.types.null.php>"
(since PHP 4)
*
"user function" (PHP 3 only, deprecated)
*
"unknown type"
Please tell me what I should use ?
--
Regards,
Alf Stockton www.stockton.co.za
A classic is something that everyone wants to have read
and nobody wants to read.
-- Mark Twain, "The Disappearance of Literature"
My email disclaimer is available at www.stockton.co.za/disclaimer.html
--- End Message ---
--- Begin Message ---
> >>I get
> Please suggest what data type you would use. In the database the
> requisit field is a datetime but I cannot find in either adodb or php
> document a datetime type.
I suggest you augment your research with google:
http://www.google.co.uk/search?hs=tAt&hl=en&client=firefox-a&rls=org.mozilla
%3Aen-GB%3Aofficial&q=mssql_bind+datetime&btnG=Search&meta=
Anyway, your answer is to be found in the manual, here (6th result on
google):
http://www.php.net/function.mssql-query
in the user notes
Cheers
Mark
> A little further down in the manual you refer to above it says interalia:-
> [$*type*] Consult mssql_bind <http://php.net/mssql_bind> and
> ocibindbyname <http://php.net/ocibindbyname> docs at php.net for more
> info on legal values for type.
> and neither mssql_bind <http://php.net/mssql_bind> nor ocibindbyname
> <http://php.net/ocibindbyname> led me to a list of types but looking at
> GetType gave me the following list?????
>
These are php data types, we are talking SQL server data types here
> *
>
> "*boolean*
> <http://www.php.net/manual/en/language.types.boolean.php>" (since
> PHP 4)
--- End Message ---
--- Begin Message ---
Alf Stockton wrote:
Mark Rees wrote:
I get 2005/09/16 10:09:22 AM which is exactly the same format as it
appears in the database table when viewed via Enterprise Manager.
I wouldn't set too much store by how it looks in EM. It is a datetime
value,
so its internal representation will be quite different.
It seems likely that $actualdate isn't actually a datetime by the time it
gets to the database, for whatever reason.
Note this line from the adodb docs: (I am presuming you are using
ADODB for
PHP here)
If $type parameter is set to false, in mssql, $type will be dynamicly
determined based on the type of the PHP variable passed (string =>
SQLCHAR,
boolean =>SQLINT1, integer =>SQLINT4 or float/double=>SQLFLT8).
http://phplens.com/lens/adodb/docs-adodb.htm
I would look into supplying the data type when adding the parameter
Please suggest what data type you would use. In the database the
requisit field is a datetime but I cannot find in either adodb or php
document a datetime type.
A little further down in the manual you refer to above it says interalia:-
[$*type*] Consult mssql_bind <http://php.net/mssql_bind> and
ocibindbyname <http://php.net/ocibindbyname> docs at php.net for more
info on legal values for type.
and neither mssql_bind <http://php.net/mssql_bind> nor ocibindbyname
<http://php.net/ocibindbyname> led me to a list of types but looking at
GetType gave me the following list?????
*
"*boolean*
<http://www.php.net/manual/en/language.types.boolean.php>" (since
PHP 4)
*
"*integer* <http://www.php.net/manual/en/language.types.integer.php>"
*
"*double* <http://www.php.net/manual/en/language.types.float.php>"
(for historical reasons "double" is returned in case of a *float*
<http://www.php.net/manual/en/language.types.float.php>, and not
simply "float")
*
"*string* <http://www.php.net/manual/en/language.types.string.php>"
*
"*array* <http://www.php.net/manual/en/language.types.array.php>"
*
"*object* <http://www.php.net/manual/en/language.types.object.php>"
*
"*resource*
<http://www.php.net/manual/en/language.types.resource.php>" (since
PHP 4)
*
"*NULL* <http://www.php.net/manual/en/language.types.null.php>"
(since PHP 4)
*
"user function" (PHP 3 only, deprecated)
*
"unknown type"
Please tell me what I should use ?
use a string. Besides, forget all about types in PHP. PHP converts
between them automatically... what would you need to know what "type to
use" anyway? :) I can't (or barely) imagine any PHP code in which you
can *define* what type something is supposed to be (except by casting
something to another type explicitly; which is usually pretty pointless)
--- End Message ---
--- Begin Message ---
Alf Stockton wrote:
Mark Rees wrote:
I get 2005/09/16 10:09:22 AM which is exactly the same format as it
appears in the database table when viewed via Enterprise Manager.
I wouldn't set too much store by how it looks in EM. It is a datetime
value,
so its internal representation will be quite different.
It seems likely that $actualdate isn't actually a datetime by the time it
gets to the database, for whatever reason.
Note this line from the adodb docs: (I am presuming you are using
ADODB for
PHP here)
If $type parameter is set to false, in mssql, $type will be dynamicly
determined based on the type of the PHP variable passed (string =>
SQLCHAR,
boolean =>SQLINT1, integer =>SQLINT4 or float/double=>SQLFLT8).
http://phplens.com/lens/adodb/docs-adodb.htm
I would look into supplying the data type when adding the parameter
Please suggest what data type you would use. In the database the
requisit field is a datetime but I cannot find in either adodb or php
document a datetime type.
A little further down in the manual you refer to above it says interalia:-
[$*type*] Consult mssql_bind <http://php.net/mssql_bind> and
ocibindbyname <http://php.net/ocibindbyname> docs at php.net for more
info on legal values for type.
and neither mssql_bind <http://php.net/mssql_bind> nor ocibindbyname
<http://php.net/ocibindbyname> led me to a list of types but looking at
GetType gave me the following list?????
*
"*boolean*
<http://www.php.net/manual/en/language.types.boolean.php>" (since
PHP 4)
*
"*integer* <http://www.php.net/manual/en/language.types.integer.php>"
*
"*double* <http://www.php.net/manual/en/language.types.float.php>"
(for historical reasons "double" is returned in case of a *float*
<http://www.php.net/manual/en/language.types.float.php>, and not
simply "float")
*
"*string* <http://www.php.net/manual/en/language.types.string.php>"
*
"*array* <http://www.php.net/manual/en/language.types.array.php>"
*
"*object* <http://www.php.net/manual/en/language.types.object.php>"
*
"*resource*
<http://www.php.net/manual/en/language.types.resource.php>" (since
PHP 4)
*
"*NULL* <http://www.php.net/manual/en/language.types.null.php>"
(since PHP 4)
*
"user function" (PHP 3 only, deprecated)
*
"unknown type"
Please tell me what I should use ?
use a string. Besides, forget all about types in PHP. PHP converts
between them automatically... what would you need to know what "type to
use" anyway? :) I can't (or barely) imagine any PHP code in which you
can *define* what type something is supposed to be (except by casting
something to another type explicitly; which is usually pretty pointless)
--- End Message ---
--- Begin Message ---
M. Sokolewicz wrote:
Alf Stockton wrote:
Mark Rees wrote:
I get 2005/09/16 10:09:22 AM which is exactly the same format as it
appears in the database table when viewed via Enterprise Manager.
I wouldn't set too much store by how it looks in EM. It is a
datetime value,
so its internal representation will be quite different.
It seems likely that $actualdate isn't actually a datetime by the
time it
gets to the database, for whatever reason.
Note this line from the adodb docs: (I am presuming you are using
ADODB for
PHP here)
If $type parameter is set to false, in mssql, $type will be dynamicly
determined based on the type of the PHP variable passed (string =>
SQLCHAR,
boolean =>SQLINT1, integer =>SQLINT4 or float/double=>SQLFLT8).
http://phplens.com/lens/adodb/docs-adodb.htm
I would look into supplying the data type when adding the parameter
Please suggest what data type you would use. In the database the
requisit field is a datetime but I cannot find in either adodb or
php document a datetime type.
A little further down in the manual you refer to above it says
interalia:-
[$*type*] Consult mssql_bind <http://php.net/mssql_bind> and
ocibindbyname <http://php.net/ocibindbyname> docs at php.net for more
info on legal values for type.
and neither mssql_bind <http://php.net/mssql_bind> nor ocibindbyname
<http://php.net/ocibindbyname> led me to a list of types but looking
at GetType gave me the following list?????
*
"*boolean*
<http://www.php.net/manual/en/language.types.boolean.php>" (since
PHP 4)
*
"*integer*
<http://www.php.net/manual/en/language.types.integer.php>"
*
"*double* <http://www.php.net/manual/en/language.types.float.php>"
(for historical reasons "double" is returned in case of a *float*
<http://www.php.net/manual/en/language.types.float.php>, and not
simply "float")
*
"*string* <http://www.php.net/manual/en/language.types.string.php>"
*
"*array* <http://www.php.net/manual/en/language.types.array.php>"
*
"*object* <http://www.php.net/manual/en/language.types.object.php>"
*
"*resource*
<http://www.php.net/manual/en/language.types.resource.php>" (since
PHP 4)
*
"*NULL* <http://www.php.net/manual/en/language.types.null.php>"
(since PHP 4)
*
"user function" (PHP 3 only, deprecated)
*
"unknown type"
Please tell me what I should use ?
use a string. Besides, forget all about types in PHP. PHP converts
between them automatically... what would you need to know what "type
to use" anyway? :) I can't (or barely) imagine any PHP code in which
you can *define* what type something is supposed to be (except by
casting something to another type explicitly; which is usually pretty
pointless)
I accept what you are saying but then what is wrong with my original code?
$PMdriver = "mssql";
$PMdb = ADONewConnection($PMdriver);
$PMdb->Connect($PMserver, $PMuser, $PMpassword, $PMdatabase);
$SQL = $PMdb->Prepare("spGetActivePromotions");
$ActualDate = strftime("%Y/%m/%d %I:%m:%S %p");
$PMdb->InParameter($SQL, $ActualDate, "Today");
$PMdb->OutParameter($SQL, $ret, 'RETVAL');
why do I keep getting:-
201: Procedure 'spGetActivePromotions' expects parameter '@Today', which
was not supplied.
No matter how I define the variable, as Today or as @Today or as 'Today'
or as "Today" or as '@Today' or as "@Today"
--
Regards,
Alf Stockton www.stockton.co.za
Stay away from flying saucers today.
My email disclaimer is available at www.stockton.co.za/disclaimer.html
--- End Message ---
--- Begin Message ---
> > Mark Rees wrote:
> >
> >>>
> >>> I get 2005/09/16 10:09:22 AM which is exactly the same format as it
> >>> appears in the database table when viewed via Enterprise Manager.
> >>>
> >>
> >>
> >> I wouldn't set too much store by how it looks in EM. It is a datetime
> >> value,
> >> so its internal representation will be quite different.
> >>
> >> It seems likely that $actualdate isn't actually a datetime by the time
it
> >> gets to the database, for whatever reason.
> >>
> >> Note this line from the adodb docs: (I am presuming you are using
> >> ADODB for
> >> PHP here)
> >>
> >> If $type parameter is set to false, in mssql, $type will be dynamicly
> >> determined based on the type of the PHP variable passed (string =>
> >> SQLCHAR,
> >> boolean =>SQLINT1, integer =>SQLINT4 or float/double=>SQLFLT8).
> >>
> >> http://phplens.com/lens/adodb/docs-adodb.htm
> >>
> >> I would look into supplying the data type when adding the parameter
> >>
> >>
> > Please suggest what data type you would use. In the database the
> > requisit field is a datetime but I cannot find in either adodb or php
> > document a datetime type.
> > A little further down in the manual you refer to above it says
interalia:-
> > [$*type*] Consult mssql_bind <http://php.net/mssql_bind> and
> > ocibindbyname <http://php.net/ocibindbyname> docs at php.net for more
> > info on legal values for type.
> > and neither mssql_bind <http://php.net/mssql_bind> nor ocibindbyname
> > <http://php.net/ocibindbyname> led me to a list of types but looking at
> > GetType gave me the following list?????
> >
> > *
> > > > Please tell me what I should use ?
> >
> use a string. Besides, forget all about types in PHP. PHP converts
> between them automatically... what would you need to know what "type to
> use" anyway? :) I can't (or barely) imagine any PHP code in which you
> can *define* what type something is supposed to be (except by casting
> something to another type explicitly; which is usually pretty pointless)
The type problem in not in PHP but in SQL Server. The sp expects an input
parameter of type datetime, and it isn't getting one.
http://www.php.net/function.mssql-query has the answer to this question,
which is to supply the parameter as varchar and use CONVERT in the sp to
change it into a datetime
--- End Message ---
--- Begin Message ---
Mark Rees wrote:
The type problem in not in PHP but in SQL Server. The sp expects an input
parameter of type datetime, and it isn't getting one.
http://www.php.net/function.mssql-query has the answer to this question,
which is to supply the parameter as varchar and use CONVERT in the sp to
change it into a datetime
As other programs, not under my control, are already using that Stored
Procedure altering it is really not a good idea.
--
Regards,
Alf Stockton www.stockton.co.za
Good day for overcoming obstacles. Try a steeplechase.
My email disclaimer is available at www.stockton.co.za/disclaimer.html
--- End Message ---
--- Begin Message ---
The other programs I spoke of in my earlier email that are already using
that sp are written in C# not php.
--
Regards,
Alf Stockton www.stockton.co.za
Give him an evasive answer.
My email disclaimer is available at www.stockton.co.za/disclaimer.html
--- End Message ---
--- Begin Message ---
> >
> >The type problem in not in PHP but in SQL Server. The sp expects an input
> >parameter of type datetime, and it isn't getting one.
> >
> >http://www.php.net/function.mssql-query has the answer to this question,
> >which is to supply the parameter as varchar and use CONVERT in the sp to
> >change it into a datetime
> >
> >
> >
> As other programs, not under my control, are already using that Stored
> Procedure altering it is really not a good idea.
>
I think you've had it then, unfortunately, unless anyone else has solved
this problem. You could write a wrapper sp which does the conversion,
perhaps.
This looks like a really annoying problem and I can only sympathise.
You could try posing the question on php-general, many more people read it
than do this list.
good luck, and please report back if you find a solution
Mark
--- End Message ---
--- Begin Message ---
Hi,
Have you tried using the SQL Profiler??? This can output everything
that happens on the SQL Server, and specifically only output data on
SPs that execute.
So, if you put a print command inside your SP which prints the date
that it "should" be receiving, you may be able to work out of it is
indeed in the correct format. If it's blank, then indeed it is in the
wrong format, or, you are actually sending it a blank.
If the case is definitely you are sending it, then send it a text only
date as a date variable, then get the SP to print the text based date
parameter and then see what it is outputting, this could give you the
clue you are looking for.
Basically, in your SP just put the following as the first thing it
executes.
print @Today
Lastly, the line:
$PMdb->InParameter($SQL, $ActualDate, "Today");
Could it be that it expect the real name of the parameter as this:
$PMdb->InParameter($SQL, $ActualDate, "@Today");
Regards,
Kevin Smith
Mark Rees wrote:
The type problem in not in PHP but in SQL Server. The sp expects an input
parameter of type datetime, and it isn't getting one.
http://www.php.net/function.mssql-query has the answer to this question,
which is to supply the parameter as varchar and use CONVERT in the sp to
change it into a datetime
As other programs, not under my control, are already using that Stored
Procedure altering it is really not a good idea.
I think you've had it then, unfortunately, unless anyone else has solved
this problem. You could write a wrapper sp which does the conversion,
perhaps.
This looks like a really annoying problem and I can only sympathise.
You could try posing the question on php-general, many more people read it
than do this list.
good luck, and please report back if you find a solution
Mark
|
smime.p7s
Description: S/MIME Cryptographic Signature
--- End Message ---