[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 250
  • Last Modified:

need php-mysql function

I have a function for php-oracle.

function ocifetchassoc($res)
{
  $ret_array = array();
  ocifetchinto($res, $ret_array, OCI_ASSOC);
  return $ret_array;
}
Now I need to convert this to php-mysql.
Please help!
0
karunamoorthy
Asked:
karunamoorthy
  • 2
2 Solutions
 
dirknibleckCommented:
I believe the following should work...

function ocifetchassoc($res)
{
  $ret_array = mysql_fetch_array($res, MYSQL_ASSOC);
  return $ret_array;
}
0
 
karunamoorthyAuthor Commented:
I will try this.
Thank you immediate response!
0
 
Roger BaklundCommented:
There is also a mysql_fetch_assoc() function, wich returns an associative array directly:

function ocifetchassoc($res) {
  return mysql_fetch_assoc($res);
}

http://php.net/mysql_fetch_assoc
0
 
karunamoorthyAuthor Commented:
Thanks for your help
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now