954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to call Stored Procedure in mysql by php

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.

ajay_tabbu
Junior Poster in Training
52 posts since Feb 2007
Reputation Points: 24
Solved Threads: 0
 

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.

kkeith29
Nearly a Posting Virtuoso
1,357 posts since Jun 2007
Reputation Points: 235
Solved Threads: 194
 

nevermind, i did a little research on that and it is only for php 5. i have php 4 right now.

kkeith29
Nearly a Posting Virtuoso
1,357 posts since Jun 2007
Reputation Points: 235
Solved Threads: 194
 

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] . "");

}

/* 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.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.

ajay_tabbu
Junior Poster in Training
52 posts since Feb 2007
Reputation Points: 24
Solved Threads: 0
 

yes you r right this is for php5 & mysql 5(or upper version)
nevermind, i did a little research on that and it is only for php 5. i have php 4 right now.

ajay_tabbu
Junior Poster in Training
52 posts since Feb 2007
Reputation Points: 24
Solved Threads: 0
 

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

kkeith29
Nearly a Posting Virtuoso
1,357 posts since Jun 2007
Reputation Points: 235
Solved Threads: 194
 

yes kkeith you are right.after configering again my come is working fine
thanks for u r support.
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

ajay_tabbu
Junior Poster in Training
52 posts since Feb 2007
Reputation Points: 24
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You