944,208 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 17371
  • PHP RSS
Oct 15th, 2007
0

how to call Stored Procedure in mysql by php

Expand Post »
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.
Similar Threads
Reputation Points: 24
Solved Threads: 0
Junior Poster in Training
ajay_tabbu is offline Offline
52 posts
since Feb 2007
Oct 15th, 2007
0

Re: how to call Stored Procedure in mysql by php

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.
Reputation Points: 235
Solved Threads: 193
Nearly a Posting Virtuoso
kkeith29 is offline Offline
1,315 posts
since Jun 2007
Oct 15th, 2007
0

Re: how to call Stored Procedure in mysql by php

nevermind, i did a little research on that and it is only for php 5. i have php 4 right now.
Reputation Points: 235
Solved Threads: 193
Nearly a Posting Virtuoso
kkeith29 is offline Offline
1,315 posts
since Jun 2007
Oct 15th, 2007
0

Re: how to call Stored Procedure in mysql by php

ok I m sanding code also so you can reffer that cone also and can tell me where i m wrong
PHP Syntax (Toggle Plain Text)
  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.


Click to Expand / Collapse  Quote originally posted by kkeith29 ...
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.
Reputation Points: 24
Solved Threads: 0
Junior Poster in Training
ajay_tabbu is offline Offline
52 posts
since Feb 2007
Oct 15th, 2007
0

Re: how to call Stored Procedure in mysql by php

yes you r right this is for php5 & mysql 5(or upper version)
Click to Expand / Collapse  Quote originally posted by kkeith29 ...
nevermind, i did a little research on that and it is only for php 5. i have php 4 right now.
Reputation Points: 24
Solved Threads: 0
Junior Poster in Training
ajay_tabbu is offline Offline
52 posts
since Feb 2007
Oct 15th, 2007
0

Re: how to call Stored Procedure in mysql by php

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
Reputation Points: 235
Solved Threads: 193
Nearly a Posting Virtuoso
kkeith29 is offline Offline
1,315 posts
since Jun 2007
Oct 16th, 2007
0

Re: how to call Stored Procedure in mysql by php

yes kkeith you are right.after configering again my come is working fine
thanks for u r support.
Click to Expand / Collapse  Quote originally posted by kkeith29 ...
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
Reputation Points: 24
Solved Threads: 0
Junior Poster in Training
ajay_tabbu is offline Offline
52 posts
since Feb 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: htaccess
Next Thread in PHP Forum Timeline: limit text area words





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC