Re: [PHP-DEV] CVS Account Request: alawatsl

2001-11-12 Thread Jo Giraerts

one wonders where these fruitcakes keep coming from..


On Mon, Nov 12, 2001 at 01:25:23PM -, shehan alawatta wrote:
 To develop programs
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
Jo Giraerts
PHP Sorcerer
Life NV
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)16 20 89 61 
pgp-key available at: http://www.keyserver.net. 
fingerprint: 81EE B1FD 88E2 A03A 4F49 6D8A 806E 2220 9C2F 918B 

I've got these opium queens that move around my space, 
I said it's waste not, want not, 
I think I'll take another, 
I'm holding all this pain that I'm trying to smother.
branvan3000 - 
Afrodisiac

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: Sybase Stored Procedures

2001-10-02 Thread Jo Giraerts

You can only use stored procedures that output one queryresult.
The sybase-ct nor sybase-module can handle multiple queryresults, afaik.

I made a little patch to the sybase-module to return the stored procedure
errorcode, but i didn't do multiple resultsets yet. 

If you're interested in the patch, search the maillinglist for my name,
i only have a few posts so you'll find it pretty quickly.



On Tue, Oct 02, 2001 at 03:59:09PM +0100, Daniel Andersson wrote:
 we are using sybase stored procedures with no problems what so ever.
 
 just basic procedures but can't see any problem with advanced sp's.
 
 / d
 
 Thomas Janke [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  hello,
 
  I would like to use sybase stored procedures and need to know, in what
  way they are supportet in PHP. In the manual, one can read that stored
  procedures are not yet fully supported. Does anybody have any newer
  information on what Sybase features can be used with PHP4?
 
  Thank you very much for your help.
 
  Yours
  Thomas
 
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
Jo Giraerts
Computerprutser
Life BVBA
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)16 20 89 61 
pgp-key available at: http://www.keyserver.net. 
fingerprint: 81EE B1FD 88E2 A03A 4F49 6D8A 806E 2220 9C2F 918B 

I've got these opium queens that move around my space, 
I said it's waste not, want not, 
I think I'll take another, 
I'm holding all this pain that I'm trying to smother.
branvan3000 - 
Afrodisiac

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Sybase and Sybase-CT and MSSQL, oh my?]

2001-09-06 Thread Jo Giraerts

On Thu, Sep 06, 2001 at 08:58:32AM -0500, Brian Foddy wrote:
 Frank M. Kromann wrote:
 
  I dont know muct about Subase and Sybase-ct but I agrre that these extension 
should be combined into one, with aliases and functionality from the mssql extension 
to allow access to MSSQL Server 4.x and 6.x from Win32 and *nix clients.
  
  - Frank
 
 
 Actually these are the two most dis-simmilar API sets.  The original
 Sybase (DB-LIB) has a completely different API set than SYbase_CT
 (CT-LIB).
 Trying to merge these would probably be more work than its worth.
 Also, some people have the low level CT libs, others have the DB Libs.
 Which one would you link against?

i think it's a good idea to keep em seperate for ct-lib is still
evolving, but db-lib isn't. 

 
 Brian
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
Jo Giraerts
Computerprutser
Life BVBA
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)16 20 89 61 
pgp-key available at: http://www.keyserver.net. 
fingerprint: 81EE B1FD 88E2 A03A 4F49 6D8A 806E 2220 9C2F 918B 

I've got these opium queens that move around my space, 
I said it's waste not, want not, 
I think I'll take another, 
I'm holding all this pain that I'm trying to smother.
branvan3000 - 
Afrodisiac

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] python dictionary-like % (percent) substitution in php (was: Good idea in % (percent) substitutions in string)

2001-08-28 Thread Jo Giraerts

This is already possible in php, though with the following simple
function..

   // function to read a file with php-vars in as a string
   // $predefined_vars: an array (varname = value). all the
   // variablenames defined in this array can be used in the bodyfile.
   // They will receive the respective values. This makes personalising
   // the mailes easier..
   function file_as_body($filename, $predefined_vars)
   {
  $ar = file($filename);
  extract($predefined_vars);

  foreach ($ar as $number = $line)
  {
 eval(\$ar2[] = \$line\;);
  }

  return implode(,$ar2);
   }

and for instance this file as template:

--- template file
You received a file on ( . date(d/m/Y (H:i)) . )

filename: .basename($file) .
filesize: .filesize($file) .
mimetype: $mimetype

Hope you enjoy it..
---

You can even use php-code already, thanks to eval :)

Maybe we better make it a PEAR-thing?




On Tue, Aug 28, 2001 at 12:25:15PM +0200,  wrote:
 I have seen that in php there isn't nothing similar to dictionary
 substitution in python.
 (a dictionary is an array with string keys, like hash in perl)
 
 This change consist in adding two functions (a stay for array):
 aprintf(string format, array dict) -- like printf, print the result
 saprintf(string format, array dict) -- like sprintf, return the result
 
 It works like this (written in php-like language):
 
 format - my name is %(name)s and i'm %(age)s
 dict - array( name=tom, age= eighteen );
 
 (in php, unlike python, is possible to make an array with both string and
 number indices, so the format can be also %(2)s,...)
 
 aprintf(format,dict) -- print my name is tom and i'm eighteen
 saprintf(format,dict) -- return my name is tom and i'm eighteen
 
 in python, these substitutions are very useful, especially in cgi
 programming, for making templates from text files, in php could be
 useful in, for example, language customisation, or message formatting,
 etc...
 
 An example:
 if ($lang == it)
   define(MESSAGE,il %(animal)s %(color)s sta %(action)s %(target)s);
 else
   define(MESSAGE,the %(color)s %(animal)s is %(action)s);
 
 aprintf(MESSAGE,array(animal=cobra,color=green,action=eating,target
 =mouse));
 // if the %(target)s isn't found, is ignored.
 
 
 (the s terminator could be substituted with other letters, like d for
 numbers, etc...)
 
 This approach has several advantages over something like this:
 the $color $animal is $action
 because in this phrase, variables are substituted when the parser execute
 it, and in this case:
 the %(color)s %(animal)s is %(action)s
 parameters are substituted only when the phrase is parsed with a specialized
 function like aprintf
 
 
 
 I think that this is a good idea and could save a lot of time when the
 program need to be as modular as possible.
 
 
 Federico Marani
 [EMAIL PROTECTED]
 
 
 
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
Jo Giraerts
Computerprutser
Life BVBA
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)16 20 89 61 
pgp-key available at: http://www.keyserver.net. 
fingerprint: 81EE B1FD 88E2 A03A 4F49 6D8A 806E 2220 9C2F 918B 

I've got these opium queens that move around my space, 
I said it's waste not, want not, 
I think I'll take another, 
I'm holding all this pain that I'm trying to smother.
branvan3000 - 
Afrodisiac

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] python dictionary-like % (percent) substitution in php (was: Good idea in % (percent) substitutions in string)

2001-08-28 Thread Jo Giraerts

 function file_as_body($filename, $predefined_vars)
 {
$ar = file($filename);
extract($predefined_vars);
 
foreach ($ar as $number = $line)
{
   eval(\$ar2[] = \$line\;);
 
 Yikes, is there any reason that's not simply $ar2[] = $line;?
 
Because then the line would only be parsed until the first space..
i tried it without..


 Anyway, how does it give the same functionality as the suggest aprintf()?

oh, sorry. i didn't read the last 2 lines of the mail, where is
explained why not using plain eval.. ;)

 
 Zeev
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
Jo Giraerts
Computerprutser
Life BVBA
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)16 20 89 61 
pgp-key available at: http://www.keyserver.net. 
fingerprint: 81EE B1FD 88E2 A03A 4F49 6D8A 806E 2220 9C2F 918B 

I've got these opium queens that move around my space, 
I said it's waste not, want not, 
I think I'll take another, 
I'm holding all this pain that I'm trying to smother.
branvan3000 - 
Afrodisiac

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] R: [PHP-DEV] python dictionary-like % (percent) substitution in php

2001-08-28 Thread Jo Giraerts

True. you got a point here. i'll stop bitching :)



On Tue, Aug 28, 2001 at 04:46:35PM +0200,  wrote:
 Yes, the function you have written below make the same thing but i think
 that a function written in c, inside the php module, can be faster and more
 elegant than this php-function.
 
 Again, i think that the final user will be happy to have an already written
 function
 instead of think and code a personalized function.
 
 I think it's more elegant because it follow the same approach of printf-like
 functions
 and a user who already known these functions or known python will not have
 headaches
 in finding a solution for his problem
 
 Also prinf, sprinf, etc... can be written as php functions and separated
 from php core, but
 it will not happen... why? too important and too useful, they requires speed
 and their functionality
 is required in many programs.
 
 The same thing happen in python with dictionary substitution, and now,
 nobody think to remove
 it.
 
 I think that this type of function could be useful for a lot of people...
 
 Let me know what do you (also zeev and others) think about
 
 -
 Federico Marani
 [EMAIL PROTECTED]
 --
 
 Jo Giraerts [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]
  This is already possible in php, though with the following simple
  function..
 
 // function to read a file with php-vars in as a string
 // $predefined_vars: an array (varname = value). all the
 // variablenames defined in this array can be used in the bodyfile.
 // They will receive the respective values. This makes personalising
 // the mailes easier..
 function file_as_body($filename, $predefined_vars)
 {
$ar = file($filename);
extract($predefined_vars);
 
foreach ($ar as $number = $line)
{
   eval(\$ar2[] = \$line\;);
}
 
return implode(,$ar2);
 }
 
  and for instance this file as template:
 
  --- template file
  You received a file on ( . date(d/m/Y (H:i)) . )
 
  filename: .basename($file) .
  filesize: .filesize($file) .
  mimetype: $mimetype
 
  Hope you enjoy it..
  ---
 
  You can even use php-code already, thanks to eval :)
 
  Maybe we better make it a PEAR-thing?
 
 
 
 
 
 
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
Jo Giraerts
Computerprutser
Life BVBA
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)16 20 89 61 
pgp-key available at: http://www.keyserver.net. 
fingerprint: 81EE B1FD 88E2 A03A 4F49 6D8A 806E 2220 9C2F 918B 

I've got these opium queens that move around my space, 
I said it's waste not, want not, 
I think I'll take another, 
I'm holding all this pain that I'm trying to smother.
branvan3000 - 
Afrodisiac

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] CVSup.php.net???

2001-08-03 Thread Jo Giraerts

Can we still use that server, cause i get a Connection refused-message.

-- 
Jo Giraerts
Computerprutser
Life BVBA
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)16 20 89 61 
pgp-key available at: htt://www.keyserver.net. 
fingerprint: 81EE B1FD 88E2 A03A 4F49 6D8A 806E 2220 9C2F 918B 

I've got these opium queens that move around my space, 
I said it's waste not, want not, 
I think I'll take another, 
I'm holding all this pain that I'm trying to smother.
branvan3000 - 
Afrodisiac

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] CVS Account Request

2001-07-30 Thread Jo Giraerts

On Mon, Jul 30, 2001 at 10:06:05AM +0200, Ramsi Sras wrote:
 UNSUBSCRIBE ME PLEASE!!

excuse me, but i'm getting really annoyed by these messages all the
time. Can someone get this person out of the mailinglist, please?

or should i add him to my already-way-too-long-mailfilter?
 
-- 
Jo Giraerts
Computerprutser
Life BVBA
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)16 20 89 61 

I've got these opium queens that move around my space, 
I said it's waste not, want not, 
I think I'll take another, 
I'm holding all this pain that I'm trying to smother.
branvan3000 - 
Afrodisiac

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Multiple inserts in one sybase_query issue

2001-06-20 Thread Jo Giraerts

Well, what you are doing in the second query is actually getting more
resultsets in one query. The current sybase modules can't handle more
than 1 resultset at a time. Try running sp_help through sybase_query(),
you'll notice that only the first resultset is given back, all the rest
is discarded. I'm thinking already a while about changing this so you
can get an array of resultsets from sybase_query() which would allow you
to do the stuff you're trying to do now..

Any ideas of the group would be appreciated (as i'm not a very good
c-coder anyway)



On Mon, Jun 18, 2001 at 06:01:54PM -0500, Ben Gabrielson wrote:
 I'm running PHP 3 (and PHP 4 on another server) with Sybase 11.9.2 on the
 database server.
 
 I have tried in a number or variations to insert a series of updates and
 inserts in the same sybase_query. I build a $query consisting of around
 15-20 inserts and updates and call the sybase_query function, everything
 works fine and it writes to the database as expected however none of the
 sybase_querys after this point are recorded.
 
 For example when I create this string:
 
 $query = Declare @nonuser_signup_id numeric(10,0)\n;
 $query .= Insert into nonuser_signup (email, firstname, lastname, gender)
 values ('$email', '$firstname', '$lastname', '$gender')\n;
 $query .= Select @nonuser_signup_id = @@identity\n;
 $query .= Insert into nonuser_optin (nonuser_signup_id, optin_type_id,
 promotion_id, signup_date) values (@nonuser_signup_id, $Free_Stuff, 5,
 getdate())\n;
 $query .= Insert into nonuser_optin (nonuser_signup_id, optin_type_id,
 promotion_id, signup_date) values (@nonuser_signup_id, $Contests, 5,
 getdate())\n;
 $query .= Insert into nonuser_optin (nonuser_signup_id, optin_type_id,
 promotion_id, signup_date) values (@nonuser_signup_id, $Surveys, 5,
 getdate())\n;
 $query .= Insert into nonuser_optin (nonuser_signup_id, optin_type_id,
 promotion_id, signup_date) values (@nonuser_signup_id, $Shopping, 5,
 getdate())\n;
 $query .= Insert into nonuser_optin (nonuser_signup_id, optin_type_id,
 promotion_id, signup_date) values (@nonuser_signup_id, $Games, 5,
 getdate())\n;
 $query .= Insert into user_optin (user_id,optin_type_id,promotion_id)
 values ($user_id, 10, 5)\n;
 $result = sybase_query($query, $db);
 
 
 Everything works fine, however when its broken up like this:
 
 $query = Declare @nonuser_signup_id numeric(10,0)\n;
 $query .= Insert into nonuser_signup (email, firstname, lastname, gender)
 values ('$email', '$firstname', '$lastname', '$gender')\n;
 $query .= Select @nonuser_signup_id = @@identity\n;
 $query .= Insert into nonuser_optin (nonuser_signup_id, optin_type_id,
 promotion_id, signup_date) values (@nonuser_signup_id, $Free_Stuff, 5,
 getdate())\n;
 $query .= Insert into nonuser_optin (nonuser_signup_id, optin_type_id,
 promotion_id, signup_date) values (@nonuser_signup_id, $Contests, 5,
 getdate())\n;
 $query .= Insert into nonuser_optin (nonuser_signup_id, optin_type_id,
 promotion_id, signup_date) values (@nonuser_signup_id, $Surveys, 5,
 getdate())\n;
 $query .= Insert into nonuser_optin (nonuser_signup_id, optin_type_id,
 promotion_id, signup_date) values (@nonuser_signup_id, $Shopping, 5,
 getdate())\n;
 $query .= Insert into nonuser_optin (nonuser_signup_id, optin_type_id,
 promotion_id, signup_date) values (@nonuser_signup_id, $Games, 5,
 getdate())\n;
 $result = sybase_query($query, $db);
 $query = '';
 $query .= Insert into user_optin (user_id,optin_type_id,promotion_id)
 values ($user_id, 10, 5)\n;
 $result = sybase_query($query, $db);
 
 The last insert doesn't work. Is this a bug in PHP or am I overlooking
 something? Logically it seems that it should function the same in both
 cases.
 
 I should also note that when I break that up into a series of completely
 independant queries it works fine too, I can run a series of single inserts
 each with their own sybase_query and they all insert fine.
 
 However as you can see in the case above I am using a @@identity which makes
 splitting these up into different queries impossible.
 
 Thnaks in advance for any aid.
 
 Ben
 
 
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
Jo Giraerts
Computerprutser
Life BVBA
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)16 20 89 61 

I've got these opium queens that move around my space, 
I said it's waste not, want not, 
I think I'll take another, 
I'm holding all this pain that I'm trying to smother.
branvan3000 - 
Afrodisiac

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Writing new DB extension (looking for documentation)

2001-05-22 Thread Jo Giraerts

http://zend.com/apidoc/ is a good place to start. And read the
sourcecode


On Tue, May 22, 2001 at 02:32:45PM +0200, Fabio Rotondo wrote:
 Hi!
 
I am new in this list.
 I'd like to write a new PHP extension for
 Hummingbird SerarchServer database engine.
 I have already written a C class that connects
 and makes all the query, so I'd like to port it
 for PHP4.
 I'd like to know where I can get some docs
 to startup.
 
 Thanks,
 
Fabio
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
Jo Giraerts
Computerprutser
Life BVBA
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)16 20 89 61 

I've got these opium queens that move around my space, 
I said it's waste not, want not, 
I think I'll take another, 
I'm holding all this pain that I'm trying to smother.
branvan3000 - 
Afrodisiac

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] 4.0.6

2001-05-03 Thread Jo Giraerts

On Wed, May 02, 2001 at 11:14:38PM +0300, Zeev Suraski wrote:
 At 23:06 2/5/2001, Troels Arvin wrote:
 Note that there was no such problem with PHP 4.0.4pl1 and earlier.
 
 
 That's very odd, as PHP never considered \r alone to be a linefeed...

IIRC, Mac's use \r as an end-of-line. They don't know of \n as do pc's.


-- 
Jo Giraerts
Development Services Engineer
VA Linux Professional Services Europe
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)475/437719 

I've got these opium queens that move around my space, 
I said it's waste not, want not, 
I think I'll take another, 
I'm holding all this pain that I'm trying to smother.
branvan3000 - 
Afrodisiac

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] sybase-ct and datetime results

2001-04-26 Thread Jo Giraerts

On Wed, Apr 25, 2001 at 10:59:15PM +0200, Björn Dolkemeier wrote:
 (I posted this also to php.db, but the more I think php.dev would be a
 better place)
 
 Hello,
 
 If I do a sybase_query(select getdate(),$Conn) this will return the
 current date in the format Nov  3 1998  8:06PM (so I don't have seconds).
 I think this leads to the usage of CS_SHORT_DATE in
 ext/sybase_ct/php_sybase_ct.c (Line 275).
 
 Does somebody know, if there is a solution for getting another
 datetime-format beyond doing something like sybase_query(select
 convert(varchar,getdate(),108).

The only way for the moment is using convert(). Sybase is not playing
very nice with datetimes. I noticed this behaviour before in other
programs and came to see that it is the server which doesn't return
right.


 Wouldn't it be better to return the datetime-results of queries as a
 timestamp? Or have a php.ini-setting / global parameter how to return
 datetime-results?

so this is not an option :(


-- 
Jo Giraerts
Development Services Engineer
VA Linux Professional Services Europe
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)475/437719 

I've got these opium queens that move around my space, 
I said it's waste not, want not, 
I think I'll take another, 
I'm holding all this pain that I'm trying to smother.
branvan3000 - 
Afrodisiac

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Sybase SP status return

2001-03-02 Thread Jo Giraerts

Hi, 

i am new to this list. But i made a little patch for the sybase-module to
return status-returns of stored procedures. 
With the new function sybase_get_status() you can retrieve the latest
status that sybase returned. This is important if you want to catch
errors from a stored procedure.

for instance: 

sybase_query("sp_help non_existing_table");
echo sybase_get_status();

will show you: 

1

(which happens to be the statuscode that sp_help gives if you if
 it doesn't find the mentioned table)

This diff is made from php-4.0.3pl1 but i just tried it on php-4.0.4pl1 and it
gives no problems.


-- 
Jo Giraerts
Development Services Engineer
VA Linux Professional Services Europe
Interleuvenlaan 15A, 3001 LEUVEN, BELGIUM
icq:81939849, email:[EMAIL PROTECTED], ph0ne:+32(0)475/437719 

-BEGIN GEEK CODE BLOCK-
Version: 3.1
GIT/GMU dx(--) s: a-- C L+++$ P+ E--- W++ N++(+) !o K? w--- !0 M- 
V? PS+++ PE- Y+ PGP++ t+@ 5- X(-) R(*) tv-@ b+++ DI++ D+ G++ e* h(+) r- y+
--END GEEK CODE BLOCK--



diff -Naur php-4.0.3pl1/ext/sybase/Makefile php-4.0.3pl11-tweaked/ext/sybase/Makefile
--- php-4.0.3pl1/ext/sybase/MakefileThu Jan  1 01:00:00 1970
+++ php-4.0.3pl11-tweaked/ext/sybase/Makefile   Fri Jan 19 16:54:14 2001
@@ -0,0 +1,12 @@
+top_srcdir   = /usr/local/php-soft/php-4.0.3pl11-tweaked
+top_builddir = /usr/local/php-soft/php-4.0.3pl11-tweaked
+srcdir   = /usr/local/php-soft/php-4.0.3pl11-tweaked/ext/sybase
+builddir = /usr/local/php-soft/php-4.0.3pl11-tweaked/ext/sybase
+VPATH= /usr/local/php-soft/php-4.0.3pl11-tweaked/ext/sybase
+
+LTLIBRARY_NAME= libsybase.la
+LTLIBRARY_SOURCES = php_sybase_db.c
+LTLIBRARY_SHARED_NAME = php_sybase_db.la
+LTLIBRARY_SHARED_LIBADD = $(SYBASE_SHARED_LIBADD)
+
+include $(top_srcdir)/build/dynlib.mk
diff -Naur php-4.0.3pl1/ext/sybase/libs.mk php-4.0.3pl11-tweaked/ext/sybase/libs.mk
--- php-4.0.3pl1/ext/sybase/libs.mk Thu Jan  1 01:00:00 1970
+++ php-4.0.3pl11-tweaked/ext/sybase/libs.mkFri Jan 19 16:53:31 2001
@@ -0,0 +1,6 @@
+LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo) $(LTLIBRARY_OBJECTS_X)
+LTLIBRARY_SHARED_OBJECTS = $(LTLIBRARY_OBJECTS:.lo=.slo)
+$(LTLIBRARY_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES)
+   $(LINK) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_LIBADD)
+
+targets = $(LTLIBRARY_NAME)
diff -Naur php-4.0.3pl1/ext/sybase/php_sybase_db.c 
php-4.0.3pl11-tweaked/ext/sybase/php_sybase_db.c
--- php-4.0.3pl1/ext/sybase/php_sybase_db.c Sun Sep  3 19:43:09 2000
+++ php-4.0.3pl11-tweaked/ext/sybase/php_sybase_db.cFri Jan 19 16:01:24 2001
@@ -46,7 +46,7 @@
PHP_FE(sybase_select_db,NULL)
PHP_FE(sybase_query,NULL)
PHP_FE(sybase_free_result,  NULL)
-   PHP_FE(sybase_get_last_message, NULL)
+   PHP_FE(sybase_get_last_message, NULL)
PHP_FE(sybase_num_rows, NULL)
PHP_FE(sybase_num_fields,   NULL)
PHP_FE(sybase_fetch_row,NULL)
@@ -58,6 +58,7 @@
PHP_FE(sybase_result,   NULL)
PHP_FE(sybase_min_error_severity,   NULL)
PHP_FE(sybase_min_message_severity, NULL)
+   PHP_FE(sybase_get_status,   NULL)
PHP_FALIAS(mssql_connect,   sybase_connect, NULL)
PHP_FALIAS(mssql_pconnect,  sybase_pconnect,NULL)
PHP_FALIAS(mssql_close, sybase_close,   NULL)
@@ -236,6 +237,7 @@
php_sybase_module.server_message = empty_string;
php_sybase_module.min_error_severity = 
php_sybase_module.cfg_min_error_severity;
php_sybase_module.min_message_severity = 
php_sybase_module.cfg_min_message_severity;
+   php_sybase_module.status = -69696969; /* just to test for a moment */
return SUCCESS;
 }
 
@@ -694,7 +696,7 @@
 PHP_FUNCTION(sybase_query)
 {
pval *query,*sybase_link_index;
-   int id,type,retvalue;
+   int id,type,retvalue, error;
sybase_link *sybase_ptr;
sybase_result *result;
int num_fields;
@@ -729,14 +731,24 @@

convert_to_string(query);
if (dbcmd(sybase_ptr-link,query-value.str.val)==FAIL) {
-   /*php_error(E_WARNING,"Sybase:  Unable to set query");*/
+   php_error(E_WARNING,"Sybase:  Unable to set query");
RETURN_FALSE;
}
+
if (dbsqlexec(sybase_ptr-link)==FAIL || dbresults(sybase_ptr-link)==FAIL) {
-   /*php_error(E_WARNING,"Sybase:  Query failed");*/
+   php_error(E_WARNING,"Sybase:  Query failed");
RETURN_FALSE;
}

+   /* Setting the return-status of stored procedures 
+   There's still something weird going on: 
+   if (status==0) it doesn't get returned properly
+   */