need php-mysql function

Posted on 2009-02-20
Last Modified: 2012-06-27
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!
Question by:karunamoorthy
    LVL 15

    Accepted Solution

    I believe the following should work...

    function ocifetchassoc($res)
      $ret_array = mysql_fetch_array($res, MYSQL_ASSOC);
      return $ret_array;
    LVL 7

    Author Comment

    I will try this.
    Thank you immediate response!
    LVL 39

    Assisted Solution

    by:Roger Baklund
    There is also a mysql_fetch_assoc() function, wich returns an associative array directly:

    function ocifetchassoc($res) {
      return mysql_fetch_assoc($res);
    LVL 7

    Author Closing Comment

    Thanks for your help

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now