ainoy31 Posted November 24, 2008 Share Posted November 24, 2008 Hello- I am running into an issue where I am making a function call multiple times. So, I have say function X that accepts a parameter. This function X is in a different directory from where I am making a call. OK. I make the first call to function getProductName and pass it a parameter. $prodID = 1; $data = $obj->getProductName($prodID); public function getproductName($id) { this takes the id that was passed in and returns the product name } Then, I make a second call to the same function but with a different product id $prodID = 49; $data = $obj->getProductName($prodID); public function getproductName($id) { this takes the id that was passed in and returns the product name } The issue I am facing is that on the second call to the getProductName function, it is using the value 1 from the first call rather than the value of the second call of 49. Then it returns the same product name as the first call. I hope this is clear to understand. I can not understand why this is happening. Maybe I am making this harder that it seems. Much appreciation. AM Link to comment https://forums.phpfreaks.com/topic/134128-solved-function-call/ Share on other sites More sharing options...
corbin Posted November 24, 2008 Share Posted November 24, 2008 We need to see more code. Link to comment https://forums.phpfreaks.com/topic/134128-solved-function-call/#findComment-698208 Share on other sites More sharing options...
ainoy31 Posted November 25, 2008 Author Share Posted November 25, 2008 Figured out my issue. I was wrapping an array into another array on the call to the method that gets me the product name. Thanks. Link to comment https://forums.phpfreaks.com/topic/134128-solved-function-call/#findComment-698698 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.