how to call Stored Procedure in mysql by php

Reply

Join Date: Feb 2007
Posts: 52
Reputation: ajay_tabbu is an unknown quantity at this point 
Solved Threads: 0
ajay_tabbu's Avatar
ajay_tabbu ajay_tabbu is offline Offline
Junior Poster in Training

how to call Stored Procedure in mysql by php

 
0
  #1
Oct 15th, 2007
hello friends,
I am working with stored procedure in my sql.I m traying to call SP in php but i fail to do that.
I have already configer mysqli.dll file in php. but still i m gating error :Fatal error: Call to undefined function mysqli_connect() in C:\Employees\Ajay\SP\test.php on line 4

can any one tell me why i m gating this error.
Last edited by ajay_tabbu; Oct 15th, 2007 at 7:55 am.
i m oblised for all member of daniweb.as helping me every time.this is best site for those who want to learn themself.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,227
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: how to call Stored Procedure in mysql by php

 
0
  #2
Oct 15th, 2007
i will try to configure that on my server to see if i get the same error. then if i am successful i will tell you how i did it.
Last edited by kkeith29; Oct 15th, 2007 at 8:10 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,227
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: how to call Stored Procedure in mysql by php

 
0
  #3
Oct 15th, 2007
nevermind, i did a little research on that and it is only for php 5. i have php 4 right now.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 52
Reputation: ajay_tabbu is an unknown quantity at this point 
Solved Threads: 0
ajay_tabbu's Avatar
ajay_tabbu ajay_tabbu is offline Offline
Junior Poster in Training

Re: how to call Stored Procedure in mysql by php

 
0
  #4
Oct 15th, 2007
ok I m sanding code also so you can reffer that cone also and can tell me where i m wrong
  1. <?php
  2. ini_set("display_errors", 1);
  3. /* Connect to a MySQL server */
  4. $link = mysqli_connect('192.168.1.4','ajay','the@123');
  5.  
  6. if (!$link) {
  7. printf("Can't connect to MySQL Server. Errorcode: %s\n", mysqli_connect_error());
  8. exit;
  9. }
  10.  
  11.  
  12. /* Send a query to the server */
  13. if ($result = mysqli_query($link, "p3('crm')")) {
  14.  
  15.  
  16. /* Fetch the results of the query */
  17. while( $row = mysqli_fetch_array($result) ){
  18.  
  19. echo ($row[0]. "--------- SR. " . $row[1] . "<br>");
  20.  
  21. }
  22.  
  23. /* Destroy the result set and free the memory used for it */
  24. mysqli_free_result($result);
  25. }
  26.  
  27. /* Close the connection */
  28. mysqli_close($link);
  29. ?>

In above code p3() is my S.P. to which I want to call.


Originally Posted by kkeith29 View Post
i will try to configure that on my server to see if i get the same error. then if i am successful i will tell you how i did it.
i m oblised for all member of daniweb.as helping me every time.this is best site for those who want to learn themself.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 52
Reputation: ajay_tabbu is an unknown quantity at this point 
Solved Threads: 0
ajay_tabbu's Avatar
ajay_tabbu ajay_tabbu is offline Offline
Junior Poster in Training

Re: how to call Stored Procedure in mysql by php

 
0
  #5
Oct 15th, 2007
yes you r right this is for php5 & mysql 5(or upper version)
Originally Posted by kkeith29 View Post
nevermind, i did a little research on that and it is only for php 5. i have php 4 right now.
i m oblised for all member of daniweb.as helping me every time.this is best site for those who want to learn themself.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,227
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: how to call Stored Procedure in mysql by php

 
0
  #6
Oct 15th, 2007
there is nothing wrong with the code from what i can tell. the only thing i can think of is the configuration of php. its giving you this fatal error because the function mysqli_connect is nonexistent. you must not of configured the dll correctly
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 52
Reputation: ajay_tabbu is an unknown quantity at this point 
Solved Threads: 0
ajay_tabbu's Avatar
ajay_tabbu ajay_tabbu is offline Offline
Junior Poster in Training

Re: how to call Stored Procedure in mysql by php

 
0
  #7
Oct 16th, 2007
yes kkeith you are right.after configering again my come is working fine
thanks for u r support.
Originally Posted by kkeith29 View Post
there is nothing wrong with the code from what i can tell. the only thing i can think of is the configuration of php. its giving you this fatal error because the function mysqli_connect is nonexistent. you must not of configured the dll correctly
i m oblised for all member of daniweb.as helping me every time.this is best site for those who want to learn themself.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC