[PHP] messag length error

2004-07-14 Thread André Cupini



Hi folk's, (sorry my poor English)

I'm working with a stored procedure. 

The procedure works fine. But when i execute the 
procedure in the php script, despiste also works, i get this 
warning:
Warning: 
ibase_query(): message length error (encountered 0, expected 8) 

Anybody know why this warning?
I'm searching in the net, but.. nothing at this 
time...
* When i execute the procedure with "SELECT" 
instead "EXECUTE PROCEDURE" thisdon't work

The sourceofprocedure is 
this:

- BEGIN SP CODE 
--
BEGIN /* Verifica se o domínio já está 
cadastrado */ SELECT COUNTER_COUNT FROM COUNTER 
WHERE UPPER(COUNTER_DOMAIN) = UPPER(:COUNTER_DOMAIN) INTO 
COUNTER_RESULT;

 /* Domínio não cadastrado, insere e inicia 
o contador */ IF (:COUNTER_RESULT IS NULL) THEN 
BEGIN /* Contador */ COUNTER_RESULT 
= 1; /* Query */ INSERT INTO COUNTER 
( 
COUNTER_DOMAIN, 
COUNTER_SINCE, 
COUNTER_COUNT ) VALUES ( 
:COUNTER_DOMAIN, 
CURRENT_TIMESTAMP, 
:COUNTER_RESULT ); /* Domínio já cadastrado, 
incrementa contador */ END ELSE BEGIN /* 
Contador */ COUNTER_RESULT = 
:COUNTER_RESULT+1; /* Query */ 
UPDATE COUNTER SET COUNTER_COUNT = 
(:COUNTER_RESULT) WHERE COUNTER_DOMAIN = 
:COUNTER_DOMAIN; END /* Retorna "COUNTER_RESULT" 
*/ SUSPEND;END
--- END SP CODE 
-

Best Regards





  
  

  


       
      
  André Cupini Programador[EMAIL PROTECTED] UIN# 149947291 

  

  Rua 
Prof. José Ranieri, 9-40 CEP 17012-260Bauru/SP Fone/Fax: 
(14) 3234-6898
  Rua 
Abílio Soares, 233 Cj 32CEP 04005-000Paraíso, São 
Paulo/SPFone/Fax: (11) 
  3057-1883



  
  
...
  
The Advertising Agency 
  Song:When your client's hopping mad,Put his picture in the 
  ad.If he still should prove refractory,Add a picture of his 
  factory.


[PHP] Firebird reading data error...

2004-06-22 Thread André Cupini




Hi people, 

...first, sorry my poor english ;)

I have a system that 
accessfirebird database in a remote machine. In development, works fine 
(with Firebird 1.0). But now, the database location is a real machine where the 
system are put up (with Firebird 1.5)and when i realize a query, in the 
functions ibase_fetch_*, i have a strange problem (maybe abug?). When in 
return, are more then 2 resultof "double precision" type, i get the 
following errors: 
ibase_fetch_object(): Error 
reading data from the connection. (In the ibase_fetch_object 
line)

And in the bottom of page (in last line of 
of code): Warning: Unknown(): 
Error reading data from the connection. in Unknown on line 0 (I n ever 
seenothing likethis... unknown??? line 
0)

When i switch the servers, the code works fine again.
Anybody can help-me?

Thanks




  
  

  


   
  
  André Cupini Programador[EMAIL PROTECTED] UIN# 149947291 

  

  Rua 
Prof. José Ranieri, 9-40 CEP 17012-260Bauru/SP Fone/Fax: 
(14)3234-6898
  Rua 
Abílio Soares, 233 Cj 32CEP 04005-000Paraíso, São 
Paulo/SPFone/Fax: (11) 
  3057-1883



  
  
...
  
A recent study has found that 
  concentrating on difficult off-screenobjects, such as the faces of 
  loved ones, causes eye strain in computerscientists. Researchers into 
  the phenomenon cite the addedconcentration needed to "make sense" of 
  such unnatural threedimensional objects 
...


[PHP] No answers found - Why var and why ?

2003-09-09 Thread André Cupini
Save all programers! (sorry my brazilian english)

I have a simple doubt, but i´m tired because i not found answers...
Why, inside a class, declarare $this variables in a format var  $varname;
before of a constructor?
And, please, what intend the  signal before functions name?

I know the arguments reference methods like this:
function bla($reference_arg)

But what's the diference of the sintax:
function bla($var)

Thanks for attention

-- 
André Cupini
Programador - NeoBiz
[EMAIL PROTECTED]
http://www.neobiz.com.br

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



[PHP] PHP + Firebird problem with blob field size

2003-07-29 Thread André Cupini



Hello people,
First: sorry my 
weak english. I´m brazilian. 
I havethe fallowblob field in my 
database:
CREATE DOMAIN DM_TEXT AS BLOB SUB_TYPE 1 SEGMENT 
SIZE 5000 CHARACTER SET NONEWhen a try insert text great then 32000 bytes, i 
get error.
In the interbase.log, appears the line: 
ds__alloc: non-positive size allocation request
I´m despaired. I tried change the 
TCP_REMOTE_BUFFER in the isc_config file, still tried change the database 
page_size (i modified to 16 Kb - 256Gb), but still don´t work. I don´t know 
nobody for who i can ask this. Anybody help-me? 
Please!

Thanks for 
all





  
  

André 
  Cupini Programador[EMAIL PROTECTED] 
  UIN# 149947291 
  
Rua Prof. 
  José Ranieri, 9-40 CEP 17012-260Bauru/SP Fone/Fax: 
  (14)227-4646
Rua Abílio 
  Soares, 233 Cj 32CEP 04005-000Paraíso, São Paulo/SPFone/Fax: 
  (11) 3051-7604





[PHP] Problem with FirwBird date

2003-03-28 Thread André Cupini
Hello people,
I´m have a problem when work with date in a Firebird date field. By
default, Firebird set up the date format as month/day/year. I need date in
day/month/year format. In a Linux, i just add to the php.ini the following
line:
ibase.dateformat = %d/%m/%Y
But in a machine with Apache+PHP+Firebird, it´s don´t work.

Anybody help-me please?
Thanks for attention.



André Cupini - Programador

[EMAIL PROTECTED]

NeoBiz - fábrica de internet
http://www.neobiz.com.br


Re: [PHP] Q. How to remove new line/CrLf in string??

2003-03-20 Thread André Cupini
Jack,
I replace the \n char by nothing in my scripts of the following form:

?
$string = str_replace(\n, , $string);
?

--
André Cupini - Programador
--
[EMAIL PROTECTED]
--
NeoBiz - fábrica de internet
http://www.neobiz.com.br
--

  - Original Message - 
  From: Jack Schroeder 
  To: [EMAIL PROTECTED] 
  Sent: Thursday, March 20, 2003 5:19 PM
  Subject: [PHP] Q. How to remove new line/CrLf in string??



  Hello:
  I am trying to use an ASCII/Txt database for a 'for sale by owner' site. 
  I need to figure out a way to remove any carriage returns entered into a
  Comments string because \n is the record delimiter. I have tried the
  nl2br() fundtion but that seems to ad the BR but doesn't remove the
  \n. Any help any one. 

  Thanks

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


Re: [PHP] sorting results in PHP

2003-03-17 Thread André Cupini
Bill
Try this:

while ($crow=mysql_fetch_array($cresult)) {
  $therow[]=$crow;
}
sort($therow);


André Cupini
Programador
[EMAIL PROTECTED]
NeoBiz - fábrica de internet
http://www.neobiz.com.br

  - Original Message - 
  From: bill 
  To: [EMAIL PROTECTED] 
  Sent: Monday, March 17, 2003 11:54 AM
  Subject: [PHP] sorting results in PHP


  I have a query that returns results including the fields Year, Month, and Day
  that I want to sort by date.

  Because of the nature of the query (it includes a GROUP BY statement), I cannot
  sort it in the query.

  How can I sort the results?

  I tried to use asort() while designating the field but that didn't work.

  while ($crow=mysql_fetch_array($cresult)) {
$therow[]=$crow;
  }
  asort($therow[Year]);
  reset($therow);
  asort($therow[Month]);
  reset($therow);
  asort($therow[Day]);
  reset($therow);

  ideas?

  kind regards,

  bill




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

[PHP] Another questions about usning session.

2003-03-12 Thread André Cupini
* People, sorry my ugly English. I´m Brazilian...

I am looking for learning more about sessions... I´m test this code below
don´t work with me My php version is 4.1.2.
Anybody have a complete example code of how use sessions?
Another doubt: Sessions use cookies? What the advantage in use sessions
instead of cookies?

André Cupini
Programador
[EMAIL PROTECTED]
NeoBiz - fábrica de internet
http://www.neobiz.com.br


Definitely.

- enable cookies on your browser
- make sure you're using PHP = 4.1

1. Start with a blank text file.

2. Copy and paste this in:
---
?php
session_start();
if (!isset($_SESSION['count'])) {
$_SESSION['count'];
}
else {
$_SESSION['count']++;
}
?
Hello visitor, you have seen this page ?php echo $_SESSION['count'] ?
times.p
To continue, A HREF=?php echo $_SERVER['PHP_SELF']; ?click here/A
---

3. Open it up in your browser, and test that it works (the value of
$_SESSION['count'] should increase with each click)

4. If that much works, open up the URL in a second window, and try to run
two separate sessions... (the first window might be on 10 clicks, and the
new one will be starting from 1)

5. If we're still cool, now try it without cookies maybe, by adding the SID
to the URL that they click on.


If all this works, then the problem is obviously in your code somewhere, not
an issue with PHP/sessions/browsers/cookies/etc.


Justin



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


Re: [PHP] Another questions about usning session.

2003-03-12 Thread André Cupini
I´m beginning in this list but already see that she´s better that any other.
Thanks for all! My doubt is clarified.

André Cupini
Programador
[EMAIL PROTECTED]
NeoBiz - fábrica de internet
http://www.neobiz.com.br

  - Original Message - 
  From: Ray Hunter 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, March 12, 2003 2:13 PM
  Subject: Re: [PHP] Another questions about usning session.


  But also note that session data can be stolen by other users too...

  --
  Ray

  On Wed, 2003-03-12 at 10:10, Marek Kilimajer wrote:
   Advantage of session is that you can trust the variables you keep in 
   your session. cookies can be spoofed
   
   André Cupini wrote:
   
   * People, sorry my ugly English. I´m Brazilian...
   
   I am looking for learning more about sessions... I´m test this code below
   don´t work with me My php version is 4.1.2.
   Anybody have a complete example code of how use sessions?
   Another doubt: Sessions use cookies? What the advantage in use sessions
   instead of cookies?
   
   André Cupini
   Programador
   [EMAIL PROTECTED]
   NeoBiz - fábrica de internet
   http://www.neobiz.com.br
   
   
   Definitely.
   
   - enable cookies on your browser
   - make sure you're using PHP = 4.1
   
   1. Start with a blank text file.
   
   2. Copy and paste this in:
   ---
   ?php
   session_start();
   if (!isset($_SESSION['count'])) {
   $_SESSION['count'];
   }
   else {
   $_SESSION['count']++;
   }
   ?
   Hello visitor, you have seen this page ?php echo $_SESSION['count'] ?
   times.p
   To continue, A HREF=?php echo $_SERVER['PHP_SELF']; ?click here/A
   ---
   
   3. Open it up in your browser, and test that it works (the value of
   $_SESSION['count'] should increase with each click)
   
   4. If that much works, open up the URL in a second window, and try to run
   two separate sessions... (the first window might be on 10 clicks, and the
   new one will be starting from 1)
   
   5. If we're still cool, now try it without cookies maybe, by adding the SID
   to the URL that they click on.
   
   
   If all this works, then the problem is obviously in your code somewhere, not
   an issue with PHP/sessions/browsers/cookies/etc.
   
   
   Justin
   
   
   
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
   
 
   
   


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