User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,540 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,275 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3735 | Replies: 6
Reply
Join Date: Feb 2007
Location: india
Posts: 52
Reputation: ajay_tabbu is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
ajay_tabbu's Avatar
ajay_tabbu ajay_tabbu is offline Offline
Junior Poster in Training

Question how to call Stored Procedure in mysql by php

  #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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation: kkeith29 is on a distinguished road 
Rep Power: 3
Solved Threads: 72
kkeith29's Avatar
kkeith29 kkeith29 is online now Online
Practically a Master Poster

Re: how to call Stored Procedure in mysql by php

  #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  
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation: kkeith29 is on a distinguished road 
Rep Power: 3
Solved Threads: 72
kkeith29's Avatar
kkeith29 kkeith29 is online now Online
Practically a Master Poster

Re: how to call Stored Procedure in mysql by php

  #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  
Join Date: Feb 2007
Location: india
Posts: 52
Reputation: ajay_tabbu is an unknown quantity at this point 
Rep Power: 2
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

  #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
<?php
ini_set("display_errors", 1); 
/* Connect to a MySQL server */
$link = mysqli_connect('192.168.1.4','ajay','the@123');

if (!$link) {
printf("Can't connect to MySQL Server. Errorcode: %s\n", mysqli_connect_error());
exit;
}


/* Send a query to the server */
if ($result = mysqli_query($link, "p3('crm')")) {


/* Fetch the results of the query */
while( $row = mysqli_fetch_array($result) ){

echo ($row[0]. "--------- SR. " . $row[1] . "<br>");

}

/* Destroy the result set and free the memory used for it */
mysqli_free_result($result);
}

/* Close the connection */
mysqli_close($link);
?>

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  
Join Date: Feb 2007
Location: india
Posts: 52
Reputation: ajay_tabbu is an unknown quantity at this point 
Rep Power: 2
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

  #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  
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation: kkeith29 is on a distinguished road 
Rep Power: 3
Solved Threads: 72
kkeith29's Avatar
kkeith29 kkeith29 is online now Online
Practically a Master Poster

Re: how to call Stored Procedure in mysql by php

  #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  
Join Date: Feb 2007
Location: india
Posts: 52
Reputation: ajay_tabbu is an unknown quantity at this point 
Rep Power: 2
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

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 4:56 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC