Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 5th, 2004, 08:42 AM
fabianosabaoth fabianosabaoth is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Brazil
Posts: 12 fabianosabaoth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to fabianosabaoth
Arrow Firebird + PHP

I'm having problems with a stored procedure when i try to execute it in php, im my admin tool the stored procedure works very fine, but when i try to execute it through php it's showed the follow error message...

Code:
ibase_query(): message length error (encountered 0, expected 8)


My stored procedure insert a register, and after insert it gets the ID from the inserted register.

I've tried all but i didn't have success...

Stored Procedure:

Code:
begin
  INSERT INTO USUARIO (USU_DEP_ID, USU_NOME, USU_LOGIN, USU_SENHA, USU_INDEX, USU_ATV)
  values (:USU_DEP_ID, :USU_NOME, :USU_LOGIN, :USU_SENHA, '', '1');


  USU_ID = GEN_ID(GEN_USUARIO_ID,0);

  suspend;

end 


In IBExpert its the tool that i use to make the procedures, it works very fine!

Php code:

PHP Code:
 $insere_user ibase_query("EXECUTE PROCEDURE SP_INSERE_USUARIO ('$dep_id'), ('$nome'), ('$login'), ('$senha')"); 


Please someone could help me??
Thanks!

Reply With Quote
  #2  
Old August 16th, 2004, 11:23 PM
pmanten pmanten is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 51 pmanten User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Maybe if you change the code to something like this:

$stmt = "select * from sp_insere_usario (your_parameters)";
$result = ibase_query($stmt);
$row = ibase_fetch_row($result);
echo $row[0];

Reply With Quote
  #3  
Old September 22nd, 2004, 08:56 AM
busychild busychild is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 1 busychild User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i encountered the same problem, when i tried to execute interbase procedure, which returned some data in result. try to use
"select * from my_proc" instead of "execute procedure my_proc"!

Gi

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Firebird + PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT