Mysql- PHP- FLASH function. (Passing function to a package)

I've just started with ActionScript3.0, and is currently
working on a flash that is to communicate with a mysql database and
have found a great deal of example code online that I've started to
work with.
Currently I have the following package added to my project:
quote:
package
import flash.events.*;
import flash.net.*;
public class SendAndLoad
public function SendAndLoad()
public function sendData( url:String, _vars:URLVariables,
completeFunc:Function ):void
var request:URLRequest = new URLRequest( url );
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
request.data = _vars;
request.method = URLRequestMethod.POST;
loader.addEventListener( Event.COMPLETE, completeFunc );
loader.addEventListener( IOErrorEvent.IO_ERROR, onIOError );
loader.load(request);
//private function handleComplete( event:Event ):void
// var loader:URLLoader = URLLoader( event.target );
// trace( "Par: " + loader.data.par );
// trace( "Message: " + loader.data.msg );
private function onIOError(event:IOErrorEvent):void
trace("Error loading URL.");
And is running the following code in my flash:
quote:
import SendAndLoad;
import flash.net.URLVariables;
function loadUsername( event:Event ):void
var loader:URLLoader = URLLoader( event.target );
//userNameText.text = "ffff";
userNameText.text = loader.data.user;
var url:String = "pages/test.php";
var vars:URLVariables = new URLVariables();
var sal:SendAndLoad = new SendAndLoad();
sal.sendData( url, vars, loadUsername );
As you can see I am trying to seperate the function to be
called when the return value of the page I am accessing returns
with a value, so I wont need to pass all different actions to be
called on different pages I will be requesting throughout my flash
program.
But as it is now, the function loadUsername, never even gets
called, which I assume is because the package can't call the
function outside it.
As I said, I am just starting out with ActionScript 3.0, and
is kind of stuck at this.
Any thoughts?

I never tried to pass a function into a class an attempt to
execute it. I am not sure this approach will ever work.
I suggest the following approach (see code):

Similar Messages

  • Is there a PHP sleep() function in Flash?

    Hi!
    Does anyone know of a Flash function similar to the PHP
    function sleep() ?

    what i want to do is to remove some movie clips through a
    loop, but i don't want them do dissapear all at once, but one by
    one... let's say 0.2 seconds between them...
    thanks
    quote:
    Originally posted by:
    anonymous thing
    not directly... You can use a timer(setInterval) that will
    change state of your application; it might be a boolean value for
    example. Could you post, with more details, what you want to do?

  • Seach mySQL using flash + PHP

    So... I have done my studying... and I can pefectly fine
    print data into flash from mySQL.
    The problem is, is that I want to create a search in flash,
    that sends a variable to php to use in the mySQL query. WITHOUT
    opening a new page, and staying in flash.
    I can use:
    on (release) {
    getURL("get_users.php", _blank, "POST");
    and it will post my results of my input box into the php file
    and print what I tell it to
    but when I use:
    on (release) {
    receiver.onLoad = function(ok) {
    if (ok) {
    myGrid.removeAllColumns();
    myGrid.removeAll();
    for (var i = 1; i<=receiver.total; i++) {
    receiver["dataPacket"+i] =
    receiver["user_data"+(i)].split("|");
    var _FirstName:String = receiver["dataPacket"+i][0];
    var _LastName:String = receiver["dataPacket"+i][1];
    var _Age:String = receiver["dataPacket"+i][2];
    myGridArray.push({FirstName:_FirstName, Last:_LastName,
    Age:_Age});
    delete (receiver["user_data"+i]);
    myGrid.dataProvider = myGridArray;
    } else {
    myGrid.removeAllColumns();
    myGrid.removeAll();
    myGridArray.push({status:"No data was found!"});
    myGrid.dataProvider = gridArray;
    sender.sendAndLoad("get_users.php",receiver,"post");
    To try and print the results in flash.. I get screwed and my
    grid.
    I believe it is because the PHP file is not reading my POST
    from my input test and using it in the query.
    here is what my PHP query looks like:
    $query = @mysql_query("SELECT * FROM $tableName WHERE
    FirstName=
    '$_POST[search]' ORDER BY
    FirstName");
    but if I put in "FirstName='$search'"
    and I put in elsewhere $search = "Levi"
    then it finds levi and prints it to the flash file.
    I"M SO FRUSTRAITED! haha, i'm so close
    It's like flash can't do two things at once. (send AND
    receive)
    anybody ever done this before? I could really use the advice.
    do I use a "while" condition in flash? or something? I don't
    know.

    Flash can send and receive from a PHP script.
    1. You need to attach the variables to the send LoadVars
    variable.
    sender.search = expression.
    Probably in your case you have a timeline variable also named
    seach that getURL automatically sends. So you might need to
    sender.search = search;
    2. Either drop the last argument or capitalized as noted in
    documentation. sender.sendAndLoad("get_users.php", receiver,
    "POST"); Default is POST if you leave it off.
    3. Be sure PHP script functions correctly. Create a standard
    HTML form to send the data to your PHP script and look at the
    output. That output is what Flash received in the return LoadVars
    object as your code appears to be trying to pickup. But be sure by
    looking at it.
    You also could loop using for(key in receiver) to trace the
    variables to verify what you are receiving instead of creating an
    HTML test form.
    Be sure to also trace the ok argument in receiver.onLoad.
    4. Look at strict typing all variables.
    reciever.onLoad = function(ok:Boolean) for example.

  • Tables created with PHP 'while' function

    Hi All,
    I am new at this, so please be gentle.
    I have written a page that uses the PHP "while" function, to
    get data from a mysql database, and display it in a page.
    I have enclosed the function within a table so that the
    results are contained together, but when the next loop of data
    comes, the next table is placed on top of the previous. If I just
    return one item and don't group it in a table, the data is
    displayed side by side (which is what I want).
    I am after displaying images in two columns down the screen,
    with there name under, both returned from a database.
    Heres my code, which returns just a single column.
    <?php
    {while ($row = mysql_fetch_array($result, MYSQL_NUM))
    { ?> <table width="0"
    align="center"><tr><td height="130" valign="top">
    <div align="center"><a href="javascript:"
    onClick="MM_openBrWindow('descriptions.php','','width=650,height=550')"><img
    src="<?php echo $row[0]; ?>" alt="" name="" width="120"
    height="120" border="0"></a></div>
    <div align="center"><?php echo $row[1];
    ?></tr></table>
    Any ideas???
    Dan

    Make sure that your database is up.
    Try to connect by user internal password is oracle.
    The internal user is synoym for sys user.
    You have to create a seperate tablespace and then try to use that tablespace. Because default tablespace is system in which you might not have the permession to create a table.
    Hope so this will work.
    Nikhil
    Vadodara

  • PHP mail() function not working

    Hello, I am having a problem sending mail with php while hosting my own website with apache on my mac. First of all I would like to note that I do not have a large background with web hosting and php. Everything that I did so far was just suggestions from online articles and other forums, so please include detail with any answers.
    I have apache started, and my website hosted just fine. I can also view php pages so I know php is running too. My problem is using the php mail() function.
    I have a simple form in my site who's action attribute is set to results.php. In the results.php file I have the mail() function (along with html code displaying "thank you...blah blah blah") sending info from the form to my email address. I never get an error on the php side, but my mail never gets sent.
    Is there some type of setting in a config file that need to be turned on or changed?
    Here is what I have done/modified so far from my research from online articles. i dont know what some of them mean, but followed the steps correctly:
    Edited the /etc/hostconfig file and added the line MAILSERVER=-YES-
    Edited the /etc/postfix/main.cf file and uncommented the #myhostname = ...line and made it "myhostname = localhost" (without quotes)
    Edited the php.ini file to the following - The line under where it says
    ; For unix only. You may supply arguments as well (default: "sendmail -t -i")
    Sendmail_path = usr/sbin/sendmail -t -i
    I opened the mail.log file and here are some entries from the other day:
    Code:
    Jul 9 08:16:50 new-host postfix/master[689]: daemon started -- version 2.4.3, configuration /etc/postfix
    Jul 9 08:16:50 new-host postfix/qmgr[691]: 4B4DC2E8331: from=<[email protected]>, size=323, nrcpt=1 (queue active)
    Jul 9 08:16:50 new-host postfix/qmgr[691]: 7A8242EE3C0: from=<[email protected]>, size=280, nrcpt=1 (queue active)
    Jul 9 08:16:50 new-host postfix/qmgr[691]: B1C052EE3C4: from=<[email protected]>, size=280, nrcpt=1 (queue active)
    Jul 9 08:16:50 new-host postfix/qmgr[691]: C281C2EE3C5: from=<[email protected]>, size=327, nrcpt=1 (queue active)
    Jul 9 08:16:50 new-host postfix/smtp[694]: 4B4DC2E8331: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=213262, delays=213261/0.05/0.86/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
    Jul 9 08:16:51 new-host postfix/pickup[690]: 0F5D22EE4DB: uid=70 from=<_www>
    Jul 9 08:16:51 new-host postfix/cleanup[692]: 0F5D22EE4DB: message-id=<20100709121651.0F5D22EE4DB@localhost>
    Jul 9 08:16:51 new-host postfix/qmgr[691]: 0F5D22EE4DB: from=<[email protected]>, size=333, nrcpt=1 (queue active)
    Jul 9 08:16:51 new-host postfix/smtp[695]: 7A8242EE3C0: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=27074, delays=27073/0.02/1.1/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
    Jul 9 08:16:51 new-host postfix/smtp[697]: C281C2EE3C5: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=26817, delays=26816/0.02/1.1/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
    Jul 9 08:16:51 new-host postfix/smtp[696]: B1C052EE3C4: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=27174, delays=27173/0.01/1.1/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
    Jul 9 08:17:23 new-host postfix/smtp[694]: connect to mx1.comcast.net[76.96.62.116]: Operation timed out (port 25)
    Jul 9 08:17:50 new-host postfix/master[689]: master exit time has arrived
    Any other suggestions on how to get this to work? I have also created a simple php file that sends mail without retreiving info from a form and also tried using several different email addresses to send to and from, but still nothing

    Edited the /etc/postfix/main.cf file and uncommented the #myhostname = ...line and made it "myhostname = localhost" (without quotes) Change that to mail.yourispname.com Then run sudo postfix reload and see if it sends mail. The reason being, is that you don't have a fully qualified domain name.
    And make that reflective in your mail() function file/template.
    Message was edited by: doug pennington

  • Communication problem MYSQL PHP XML Flash.

    I have driven myself into a corner with this so I hope someone here knows a solution.
    I am building a photogallery with a simple html layout but with a flash slideshow.
    The data for each album and photo are stored in a mysql database. Each photo-image is in one big folder on the server. With PHP I sort out which photo belongs to what album and display them accordingly. To start the slideshow people can click on a link near the album, this link will send a < href> with the album ID to an PHP file (xml.php) that will generated an XML output created from the MYSQL server. Here comes my problem:
    Loading XML into flash is no problem BUT I only know how to do this with a static or self supporting XML output. (xml.php needs the input of the album ID else it will not get the correct data). For now I have a temporary solution where I write the XML output from xml.php to a txt file and let Flash read from there, but is there a way where I can read directly from xml.php?

    Echo your formatted xml out as a string in xml.php, Flash will then read your dynamically generated XML.

  • How to use a mysql built-in function with dataprovider

    hi.
    I want to use a mysql built-in function, for example, MD5() on a column when updating a table with dataprovider.
    Something like this doesn't work:
    MyDataProviderOne.setValue("tablename.field_name", "MD5('some text')");
    How should it be done?
    thanks.
    Mike.

    hi.
    thanks. this helped, but I'd like to use also different functions, that's why, I'd rather do it by MySQL built-in functions with dataprovider... Is there any way to do that?
    best regards.
    Mike.

  • Call mysql C API function

    Hi all,
           I just have one question, how can I use mysql C API function for my labview program? I program it use dll call, but I use command "show processlist;"in mysql database,can see this process yet.So ,anybody can help me to solve this?
          Thanks,
          also , anyone have example,show...I am very appreciate...

    Do you really want to use a C API to do that? 
    I don't see the need for a C API or a call to a DLL.  I find it more logical to connect to your MySQL DB Server and run "show processlist" as an SQL Statement.
    but if you insist on using a DLL, I am guessing this link will help you:  Using Existing C Code or a DLL in LabVIEW

  • What would be the equivalent of the PHP isset function

    I am looking for the equivalent of the php isset function in order to determine if some variables were previously set using the jsp:set tag.
    Another thing which I can<t figure out is how to procede to determine if a form has been submitted, and if it has, how to retrieve the button name used to submit.
    Thanks in advance.
    -Dalzhim

    I have found out that I didn't receive the button information because of a weird behavior of Internet Explorer since that problem didn't occur with Mozilla or Firefox. It would seem that when pressing Enter when you have the focus into a field under Internet Explorer sends over the POST Data without the information of the submit button as opposed to when you simply click the button with the mouse.
    I guess I am right saying IE misbehaves in this particular case as I am more enclined to trust Mozilla which doesn't present this problem but if I'm wrong I'd like someone to point out why.

  • Calling Flash function from IE10

    Hey guys,
    So I am attempting to have some javascript call a flash function.  I have it fully working with older versions of IE, such as IE9. However IE10 will not do it. 
    I followed the example provided by Adobe here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/External Interface.html#addCallback()
    Using this example code, (in IE10) I am successfully able to send data from flash to my Javascript, but coming from the other direction, it does not work.
    The error I get is ("Object doesn't support property or Method 'methodNameHere' ")
    Does anyone have any ideas of what I might need to do?  Or does IE10 not support that communication any longer?  Any thoughts are appreciated, thanks!

    The code is that which is in the link but I will post it here below.  Here is what I am doing in my flash file:
    sendBtn.addEventListener(MouseEvent.CLICK, clickHandler);
                if (ExternalInterface.available) {
                    try {
                        output.appendText("Adding callback...\n");
                        ExternalInterface.addCallback("sendToActionScript", receivedFromJavaScript);
                        if (checkJavaScriptReady()) {
                            output.appendText("JavaScript is ready.\n");
                        } else {
                            output.appendText("JavaScript is not ready, creating timer.\n");
                            var readyTimer:Timer = new Timer(100, 0);
                            readyTimer.addEventListener(TimerEvent.TIMER, timerHandler);
                            readyTimer.start();
                    } catch (error:SecurityError) {
                        output.appendText("A SecurityError occurred: " + error.message + "\n");
                    } catch (error:Error) {
                        output.appendText("An Error occurred: " + error.message + "\n");
                } else {
                    output.appendText("External interface is not available for this container.");
            function receivedFromJavaScript(value:String):void {
                output.appendText("JavaScript says: " + value + "\n");
            function checkJavaScriptReady():Boolean {
                var isReady:Boolean = ExternalInterface.call("isReady");
                return isReady;
            function timerHandler(event:TimerEvent):void {
                output.appendText("Checking JavaScript status...\n");
                var isReady:Boolean = checkJavaScriptReady();
                if (isReady) {
                    output.appendText("JavaScript is ready.\n");
                    Timer(event.target).stop();
            function clickHandler(event:MouseEvent):void {
                if (ExternalInterface.available) {
                    ExternalInterface.call("sendToJavaScript", input.text);
    And here is exactly what is in the HTML:
    <!-- saved from url=(0014)about:internet -->
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>ExternalInterfaceExample</title>
    <script language="JavaScript">
         var jsReady = false;
         function isReady() {
             return jsReady;
         function pageInit() {
             jsReady = true;
             document.forms["form1"].output.value += "\n" + "JavaScript is ready.\n";
         function thisMovie(movieName) {
             if (navigator.appName.indexOf("Microsoft") != -1) {
                 return window[movieName];
             } else {
                 return document[movieName];
         function sendToActionScript(value) {
             thisMovie("ExternalInterfaceExample").sendToActionScript(value);
         function sendToJavaScript(value) {
             document.forms["form1"].output.value += "ActionScript says: " + value + "\n";
    </script>
    </head>
    <body onload="pageInit();">
         <form name="form1" onsubmit="return false;">
             <input type="text" name="input" value="" />
             <input type="button" value="Send" onclick="sendToActionScript(this.form.input.value);" /><br />
             <textarea cols="60" rows="20" name="output" readonly="true">Initializing...</textarea>
         </form>
    </body>
    </html>

  • What is the JSp equivalent method for PHP isset function

    Hai guys,
    can u tell me the JSP equivalent method for PHP isset function.

    isset checks what? parameters?
    if(request.getParameter("paramname") != null) {                                                                                                                                                                               

  • How call Flash function from C++?

    Communication between C++ and ActiveX Flash object is
    adjusted. The ActiveX calls C++ functions. But how a call Flash
    functions from C++?
    I try so: v_flash is control variable of the ActiveX the
    container.
    A code: v_flash. CallFunction ("test");
    No effect
    How it to make?

    Hi David, Thanks for the response. I found this solution by
    following method:
    Flash code either in class or frame:
    ExternalInterface.addCallback("sendTextToFlash",
    getTextFromJavaScript);
    public function getTextFromJavaScript(user):void {
    trace(user);
    //Now whenever JavaScript function will be called from any
    HTML or back end language then it definetly call directly that
    flash function by following method
    //HTML Code
    function sendData(user){
    //alert("values coming "+user);
    SendDataToFlashMovie(user);
    function getFlashMovieObject(movieName){
    if (window.document[movieName]){
    return window.document[movieName];
    if (navigator.appName.indexOf("Microsoft Internet")==-1){
    if (document.embeds && document.embeds[movieName])
    return document.embeds[movieName];
    else {// if (navigator.appName.indexOf("Microsoft
    Internet")!=-1) {
    return document.getElementById(movieName);
    function SendDataToFlashMovie(user) {
    var flashMovie=getFlashMovieObject("myFLA");
    flashMovie.sendTextToFlash(user);
    Now HTML or back end language has just need to call
    sendData(
    value)
    I think its the right way, but if there is any other short
    method like just call the function name from HTML and that directly
    respond to Flash as per function name, then please let me
    know.

  • Bootstrap + mysql + php: robust solution for an educational dashboard?

    Hi. We are just beginning work on a dashboard for educational purposes. We need to show data tables of sts progress, notes etc...
    Kind of like the following tables:
    http://www.dreambox.com/district-reports
    We have downloaded a template based on bootstrap. It is all pretty easy except for the data integration. Before we were using flash datagrids and were also looking at flex components which were very easy to use. The questions are:
    1. Can we get the same "power" for our data tables/data grids with bootstrap "ready made" plugin ins.
    2. To replicate the datadrid in flash what do we use in bootstrap - ajax datatable or a j query plug in.
    3. How do we connect up the mysql + php + datagrid. Would it be very similar to an AS3 + php + mysql solution?
    Basically, is bootstrap html5 + CSS a viable robust solution to producing an educational dashboard.
    I use the term plugin because I don't think you call them components or widgets.
    You must also know that this will be on an enterprise level and there should be around 10,000 active users - not at the same time obviously. We will be hiring a freelancer or part tim staff to implement and maintain but we do need to know which way to go first.
    Pretty broad questions maybe, just trying to find my way and study up on what I am supposed to be studying up on. I am on Lynda.com which is OK but I need some guys creating these things to give me advice and point us in the right direction.
    Cheers in advance.

    Hi - thank you Nancy - I should get really specific now.
    I spent quite a few hours investigating and here's the run down.
    1. php + mysqli: Pretty easy as it is the same workflow as I use in flash - I was just a bit thrown by the html part and still have a few questions.
    I will post the link to the very clean and easy to follow mysql + php implementation on html tables just in case any newbies are following the post.
    http://www.sourcecodetuts.com/php/18/how-create-secure-registration-page-phpmysql-part-ii
        mysqli - they seem to use the "improved" mysqli now and this code seems to be very professional with encryption etc...
    My question is which is the best method for handling the recordset back from the database.
    1. In flash we used to use XML serialized which is easy for flash objects to pick up and then display in the datagrid tables.
    2. The example in the next link echos it out in the html table format which sounds very obvious but not sure if it is correct as I have never dome that before.
    http://www.sourcecodetuts.com/php/40/creating-and-populating-table-mysql-data-using-twitte r-bootstrap-framework
    while ($row = mysql_fetch_array($result)) {
        // Print out the contents of the entry
        echo '<tr>';
        echo '<td>' . $row['firstname'] . '</td>';
        echo '<td>' . $row['lastname'] . '</td>';
        echo '<td>' . $row['email'] . '</td>';
        echo '<td>' . $row['phone'] . '</td>';
    3. However I am more used to dealing with an object returned and then dealt with in flash BUT a simple html table couldn't deal with that so - I have just started reading re: ajax or javascript. Are they the best way to handle data returned from a database. As I say this dashboard wil have to be used my many thousands and we will be creating various tables with multiple parameters inputted via dropdown box lists.
    My workflow in flash - would it be javascript that would replicate that functionality or do I just echo out in tr and td tags as in above - seems to basic.
    Sorry about repeating mysel above and going on and on but I hace finally got there - just missing the last part in the puzzle.
    Cheers

  • I can access a function in a package using OCI drivers but not PDO drivers

    Hello all, i am a newbie to Oracle and its drivers for PHP. I would like to use PDO, and I have my database activity in packages, which have procedures and functions. My package has overloaded functions and that has been giving me a tough time with these drivers. So one signature of my function get_data contains a four arguments and all four are numbers, while another signature of get_data has the first two as numbers and the next two as varchar2. So when I try to access this function which is part of a package, I am able to retrieve data, and the driver I am using is OCI8, but when I try to do the same with PDO, it does not work. It gives me this error,
    *General error: 6553 OCIStmtExecute: ORA-06553: PLS-307: too many declarations of 'GET_DATA' match this call  (/var/www/php-5.3.3/ext/pdo_oci/oci_statement.c:146)' in /var/www/pdo_check.php:251 Stack trace: #0 /var/www/pdo_check.php(251): PDOStatement->execute() #1 /var/www/pdo_check.php(345): dbPDO->execPackage2() #2 {main} thrown in /var/www/pdo_check.php on line 251 *
    I got this error earlier with OCI drivers, then I added the datatype while binding the values.
    Has anybody had this headache earlier??
    ##Works
    *$qu = oci_parse($connect, 'select pack.get_data(:p1,:p2,:p3,:p4)as rc from dual');
    $p1 = (int)121;
    $p2 = (int)222;
    $p3 = (int)324;
    $p4 = (int)001;
    oci_bind_by_name($qu,":p1",$p1,10,OCI_B_INT);
    oci_bind_by_name($qu,":p2",$p2,10,OCI_B_INT);
    oci_bind_by_name($qu,":p3",$p3,10,OCI_B_INT);
    oci_bind_by_name($qu,":p4",$p4,10,OCI_B_INT);
    oci_execute($qu) or die("did not execute");
    $r = oci_fetch_array($qu);*
    ##Does not work
    *$sql = 'select pack.get_data(:p1,:p2,:p3,:p4) from dual';
    $result = $this->dbConnect->prepare($sql);
    $p1 = (int)2;
    $p2 = (int)2;
    $p3 = (int)2;
    $p4 = (int)6;
    $result->bindParam(':p1', $p1, PDO::PARAM_INT);
    $result->bindParam(':p2', $p2, PDO::PARAM_INT);
    $result->bindParam(':p3', $p3, PDO::PARAM_INT);
    $result->bindParam(':p4', $p4, PDO::PARAM_INT);
    $result->execute();*
    I am still perplexed why is PDO giving me an error, when I have virtually mentioned everything is asks for?

    I think the only person who can really answer this question is Chris Jones. For my money I tend to steer clear of PDO as it is a bit quirky ( at least in my experience ) and it does not support reference cursors.

  • Need Help: Using Ref Cursor in ProC to call a function within a Package

    I'm calling a function within a package that is returning a REF CURSOR.
    As per the Oracle Pro*C Programmer's Guide, I did the following:
    1) declared my cursor with a: EXEC SQL BEGIN DECLARE SECTION and declared the cursor as: SQL_CURSOR my_cursor;
    2) I allocated the cursor as: EXEC SQL ALLOCATE :my_cursor;
    3) Via a EXEC SQL.....END-EXEC begin block
    I called the package function and assign the return value to my cursor
    e.g. my_cursor := package.function(:host1, :host2);
    Now, the only difference between my code and the example given in the Pro*C Programmer's Guide is that the example calls a PROCEDURE within a package that passes back the REF CURSOR as an OUT host variable.
    Whereas, since I am calling a function, the function ASSIGNS the return REF CURSOR in the return value.
    If I say my_cursor := package.function(:host1, :host2); I get a message stating, "PLS-00201: identifier MY_CURSOR" must be declared"
    If I say :my_cursor := package.function(:host1, :host2); I get a message stating, "ORA-01480: trailing null missing from STR bind value"
    I just want to call a package function and assign the return value to a REF CURSOR variable. There must be a way of doing this. I can do this easily in standard PL/SQL. How can this be done in Pro*C ???
    Thanks for any help.

    Folks, I figured it out. For those who may face this problem in the future you may want to take note for future reference.
    Oracle does not allow you to assign the return value of a REF CURSOR from a FUNCTION ( not Procedure - - there is a difference) directly to a host variable. This is the case even if that host variable is declared a CURSOR variable.
    The trick is as follows: Declare the REF CURSOR within the PL/SQL BEGIN Block, using the TYPE statement, that will contain the call to the package function. On the call, you then assign the return REF CURSOR value that the function is returning to your REF CURSOR variable declared in the DECLARE section of the EXEC SQL .... END-EXEC PL/SQL Block.
    THEN, assign the REF CURSOR variable that was populated from the function call to your HOST cursor varaible. Then fetch this HOST Cursor variable into your Host record structure variable. Then you can deference individual fields as need be within your C or C++ code.
    I hope this will help someone facing a deadline crunch. Happy computing !

Maybe you are looking for