SitePoint Sponsor

User Tag List

Results 1 to 1 of 1

Hybrid View

  1. #1
    SitePoint Addict bimalpoudel's Avatar
    Join Date
    Feb 2009
    Location
    Kathmandu, Nepal
    Posts
    279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to: User defined function returns a result set

    Is it possible to make a user defined function return a result set? How?

    For example:
    Code:
    $rs = mysql_query("SELECT udf_students(2011);");
    The above query will return all students who enrolled in 2011.

    I know how to write user defined functions in mysql.
    But cannot return a list of data into a result set that can be assigned to PHP resource variable.

    This would help me hide a lot of business logic inside the database itself.
    And save a big time.
    Last edited by bimalpoudel; Jan 30, 2011 at 09:26. Reason: UDF for saving time
    Bimal Poudel @ Sanjaal Framework over Smarty Template Engine
    ASKING INTERESTING QUESTIONS ON SITEPOINT FOURM

    Hire for coding support - PHP/MySQL


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •