Creating a array from variables passed from php

I have passed variables from PHP to flash successfully but
now need to firstly make them into an array. A next button and
previous button has to trigger the step through the array.
Any ideas?

I have a PHP script and I get flash to load the variables
from it. The code is as follows. Taken out the connection to DB for
security.
<?php
$hostname_conn = "";
$database_conn = "";
$username_conn = "";
$password_conn = "";
// establish a SQL connection to the host - host, user, pass
$conn = mysql_pconnect($hostname_conn, $username_conn,
$password_conn) or trigger_error("The site database appears unable
to provide a connection. Please contact support.
".mysql_error(),E_USER_ERROR); // or die("The site database appears
unable to provide a SQL connection. Please contact support.");
// connect to the right DB (there may be multiple db's on the
server) dbName
mysql_select_db($database_conn, $conn) or die("The site
database appears to be unavailable. Please contact support.");
$qCheck = "SELECT * FROM pics";
$rsCheck = mysql_query($qCheck) or die("Check Failed :
".mysql_error());
$cCheck = mysql_num_rows($rsCheck);?>
&img=<?php
while($row= mysql_fetch_assoc($rsCheck))
print($row["img"]);
?>

Similar Messages

  • How can I create a array with all files from a directory

    How can I create a array of files or varchar with all files from a directory?

    I thought the example could be improved upon. I've posted a solution on my blog that doesn't require writing the directory list to a table. It simply returns it as a nested table of files as a SQL datatype. You can find it here:
    http://maclochlainn.wordpress.com/2008/06/05/how-you-can-read-an-external-directory-list-from-sql/

  • How to create a array with variables dimensions?

    I try to create a array like that:
    Object[][] data;
    data = new Object[] [];
    But that's doesn't work!
    Apparently I must specify the dimension of my array
    So I have done like that :
    Object[][] data;
    data = new Object[3] [3];
    And that work!
    But the problem is when I need to add extra elements to my array.
    If I write :
    data[4][1] = "123";
    I have the error message :
    java.lang.ArrayIndexOutOfBoundsException
    So, how can I defined a array with variables dimensions OR how can I add a dimension to a array?

    if you have:
    Object[][] data;
    data = new Object[3] [3];you end yo getting ArrayIndexOutOfBoundException if you try to point to some other Indexes. You can increase the size by doing new:
    Object[][] data;
    data = new Object[4] [3];and then copy the old Arrays to this one... this is heavy.
    Other thing to consider then is using some other datastructure, such as Vector, which grows along you add elements to it.
    P_trg

  • Variable passing from sqlplus to linux.

    I have a procedure like (datapump_hr_api), after its completion, I have to grant some grants to user and then create a view which will depend on the datapump_hr_api parameter (TARGET_FIN_HR ). it will generally pass the two username, admin,hr_fin, now I have to connect to Admin and give the grant and then connec to hr and create the views.
    *****datapump_hr_api*****
    create or replace procedure datapump_hr_api(TARGET_FIN_HR_NAME varchar2) is
    h5 NUMBER; -- Data Pump job handle
    job_state VARCHAR2(30); -- To keep track of job state
    sts ku$_Status; -- The status object returned by get_status
    target_admin varchar2
    TARGET_FIN_HR varchar2(32) := TARGET_FIN_HR_NAME;
    SOURCE_FIN_HR varchar2(32);
    dumpfile varchar2(32);
    logfile varchar2(32);
    job_name varchar2(32);
    BEGIN
         select dumpfile,SOURCE_FIN_HR into dumpfile,SOURCE_FIN_HR from source_impdp;
         logfile := TARGET_FIN_HR || '.log' ;
         job_name := TARGET_FIN_HR || '2_job' ;
         h5 := DBMS_DATAPUMP.OPEN('IMPORT','FULL',NULL,job_name);
         DBMS_DATAPUMP.ADD_FILE(h5,dumpfile,'DATA_DIR');
         DBMS_DATAPUMP.ADD_FILE(handle=>h5,filename=>logfile,directory=>'DATA_DIR',
         filetype=>DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
         DBMS_DATAPUMP.METADATA_REMAP(h5,'REMAP_SCHEMA',SOURCE_FIN_HR,TARGET_FIN_HR);
         DBMS_DATAPUMP.METADATA_FILTER(h5,'EXCLUDE_PATH_EXPR','like''%/TABLE/INDEX/STATISTICS/INDEX_STATISTICS''');
         DBMS_DATAPUMP.METADATA_FILTER(h5,'EXCLUDE_PATH_EXPR','like''%/TABLE/STATISTICS/TABLE_STATISTICS''');
         DBMS_DATAPUMP.START_JOB(h5);
    job_state := 'UNDEFINED';
    while (job_state != 'COMPLETED') and (job_state != 'STOPPED') loop
    dbms_datapump.get_status(h5,
    dbms_datapump.ku$_status_job_error +
    dbms_datapump.ku$_status_job_status +
    dbms_datapump.ku$_status_wip,-1,job_state,sts);
    end loop;
    dbms_output.put_line('Job has completed');
    dbms_output.put_line('Final job state = ' || job_state);
    dbms_datapump.detach(h5);
    ----->has to be invoked create_view(TARGET_FIN_HR,Target_admin ),
    END;
    create_view statement:
    create_view: contain
    conn Target_admin/admin
    grant insert to TARGET_FIN_HR.table;
    conn TARGET_FIN_HR/fin_hr
    create view view_name as select * from Target_admin.table;
    ----

    Yes Sir,
    You are right... Your service is not just $200 hundred, it is priceless. I have never been in programming. So I am learning. And as per as "exec immediate" is concerned I have used it(Problem with SQL query sequence and you can c in the previous posting(problem with it is if you have 5 grants and 5 view, what you do). One more thing, I was just thinking if we can developed some thing like sed command does(on linus). It has to just change some table_name and username in a file but the problem was it has to pass the variable to linux and then we have to connect to ssqlplus and then we ahve to again run. I was just thinking to have expert view.
    Is not this forum made for that?
    Message was edited by:
    sanora600

  • Sort Main Report on variable passed from Subreport

    Post Author: realw
    CA Forum: Formula
    I'm working on a CR XI report. I want to be able to sort the main report on a value in the subreport. I am trying to create a shared variable to pass that value from the subreport to the main report. So far, however, the formula containing the variable in the main report is not appearing as an option in the Sort dialogue box.
    My first question is, can this be done?
    If the answer is yes, then which sections in the subreport and main report should the formula appear in?
    What I have at this point is:
    In the last Details section of Subreport, formula @ssSubCreator
    WhilePrintingRecords;Shared StringVar Cre;Cre:= {CreCreat_csv.SummaryData};
    In the Report Header of the Main report, formula @ssCre
    Shared StringVar Cre:="";
    In the Details section of the Main report, following the section containing the Subreport, formula @ssCreator
    Shared StringVar Cre;Cre
    I can see that the data is passing correctly to the Main report. I've tried moving the formulas around to different sections in the sub and main reports but haven't gotten the formula to be sortable.
    Thanks in advance for any assistance,
    Will

    Post Author: bettername
    CA Forum: Formula
    How about just grouping the data in the main report on the formula? (Supress group header and footer, obviously)
    I don't have crystal to hand right now to check if that'll work though - you may run into problems with the 'cannot evaluate at this time' issue... but I use this technique for sorting data based on a chosen parameter (say: surname, forenames, age) in this way...

  • Global Variables passing from standard form for use on custom form

    Hi,
    I'm trying to grab a value from a standard form, and pass it to a new custom form, which I am opening automatically from the standard form via personalizations. Is anyone aware of a way to send a value from one form to another? I was going to try using a global variable, which it looks like you can set through personalization. I tried doing it by passing the value as a form parameter, which works if I hard code a value, but it doesn't work if I refer to a value from the standard form.

    in your E-Business-environment may exist some special codings, which you have to think of, when passing parameters through the application.
    Copy the question to your EBS-Forum. They know ways using personalization and passing parameters

  • Variable passing from unix to sqlscript and using in insert

    please let me know how can I read a value from unix to my insert statement
    SYSTEM>!cat test.sh
    sqlplus system/oracle @/export/home/oracle/test.sql $1,$2,$3
    test.sql
    begin
    insert into source_impdp($1,$2,$3);
    commit;
    end;

    Obviously this will work only when you have shell variables 1, 2 and 3. However I don't think variable names can start with a digit.
    So you would end up with either 1 of the two below solutions
    export var1=....
    export var2=...
    export var3=...
    # Please note in the following line the comma should be a space
    sqlplus system/oracle @/export/home/oracle/test.sql $var1 $var2 $var3
    define meaningful1='&1'
    define meaningful2='&2'
    define meaningful3='&3'
    declare
    begin
    insert into source_impdp('&meaningful1','&meaningful2','&meaningful3');
    commit;
    end;
    OR
    export var1=....
    export var2=...
    export var3=...
    sqlplus system/oracle @/export/home/oracle/test.sql <<EOD
    define meaningful1='$var1'
    define meaningful2='$var2'
    define meaningful3='$var3'
    declare
    begin
    insert into source_impdp('&meaningful1','&meaningful2','&meaningful3');
    commit;
    end;
    EOD
    Hth
    Sybrand Bakker
    Senior Oracle DBA

  • Variables - Passing from frame to frame

    Hello,
    I am wondering if anyone can help me, and what I need to do
    is even possible :S
    I have a simple flash document where all the code is running
    in frames on the timeline, not the most efficient way I know, but
    it is sufficient for what I need to do in this case :D
    I have an input field on the first frame and the user puts
    their name in, this then gets passed to a variable named
    "forename". The thing I need to do is pass that variable onto the
    next frame to input into a dynamic text field.
    I have put the code off the first frame below to try and
    explain better.
    var forename:String = "";
    forename = forename_txt.text;
    So I need to take the forename and put it into a text field
    on the next frame. However at present flash throws an error up, in
    the past I would have solved this using a _global variable, but
    this no longer exists in action script 3.0 does it??
    Many thanks for any help, it is greatfully recieved.
    Kind regards
    Jude

    If you declare a variable on the first frame of the timeline,
    you should be able to access it no matter what frame you are on.
    //FRAME 1
    var forename:String = "";
    btn.addEventListener(MouseEvent.CLICK, nextFunc);
    function nextFunc (ev:MouseEvent):void {
    btn.removeEventListener(MouseEvent.CLICK, nextFunc);
    forename = forename_txt.text;
    gotoAndStop(2);
    //FRAME 2
    trace(forename); //outputs the text that was in
    forename_txt

  • How do I create an array with variables also splits words  in a txtfile?

    Hello guys,
    I made a script that reads a text file.
    function readMyFile()
    var myFile=File(app.activeDocument.filePath + "/LareLog.txt");
    if (myFile.exists)
            myFile.open("r");
            var Temps =  myFile.read();
            alert (Temps);                          // message the content
            var nyRad=("\n");                    // break the line
            textArr=Temps.split(nyRad);
            alert(textArr);                          // message the content with all info on new lines ("\n");
            myFile.close();
    my textfile contains:
    ~/Desktop/3.indd ,Thu Mar 20, 2014, 11:26:34 , GMT+0100
    I wonder how do I sort the content in array
    in this order, also creates variables for each string.
    var= string 1[~/Desktop/3.indd]
    var2=string 2[11:26:34]
    var3=string 3[11:26:34]
    var4=string 4[2014]
    var5=string 5 [GMT+0100]
    Thank you in advance people.

    Hmmh?
    Jump_Over said it before: „… are stored as separate array's elements …“ in your [textArr]
    So you can create now variables on this way:
    var string_1 = textArr[0]; // and so on
    alert(string_1);
    See Java Scripting reference for more examples how to use Arrays.

  • Formatted .data file, reading in and creating an array of objects from data

    Hi there, I have written a text file with the following format;
    List of random personal data: length 100
    1 : Atg : Age 27 : Income 70000
    2 : Dho : Age 57 : Income 110000
    3 : Lid : Age 40 : Income 460000
    4 : Wgeecnce : Age 43 : Income 370000
    and so on.
    These three pieces of data, Name,Age and Income were all generated randomly to be stored in an array of objects of class Person.
    Now what I must do is , read in this very file and re-create the array of objects that they were initially written from.
    I'm totally lost on how to go about doing this, I have only been learning java for the last month so anyone that can lend me a hand, that would be superb!
    Cheers!

    Looking at you other thread, you are able to create the code needed - so what's the problem?
    Here's an (not the only) approach:
    Create an array of the necessary length to hold the 3 variables, or, if you don't know the length of the file, create a class to contain the data. Then create an ArrayList to hold an instance of the class..
    Use the Scanner class to read and parse the file contents into the appropriate variables.
    Add each variable to either the array, or to an instance of the class and add that instance to the arraylist.

  • Help creating 2D array from tab delimited text file

    I can print the info from the file, but darned if I can't make a 2-D array.
    import java.util.regex.*;
    import java.io.*;
    public final class goodSplitter {
        private static BufferedReader br;
        private static BufferedReader br2;
        private static String INPUT;
        private static int numLines;
        private static int numLine2;
        private static int q;
        private static int t;
        private static int n;
        private static String [][] indexArray;
        public static void main(String[] argv) {
            initResources();
            processTest();
            closeResources();
        private static void initResources() {
           try {
                  br = new BufferedReader(new FileReader("index.txt"));
              System.out.println("found the input file.");
                } catch (FileNotFoundException fnfe)
                   System.out.println("Cannot locate input file! "+fnfe.getMessage());
                          System.exit(0);
           try {
                  br2 = new BufferedReader(new FileReader("index.txt"));
              System.out.println("found file again.");
                } catch (FileNotFoundException fnfe)
                   System.out.println("Cannot locate input file again! "+fnfe.getMessage());
                          System.exit(0);
         try {     
                   int numLines = 0;     
                   while ( ( INPUT = br.readLine( ) ) != null )
                        { numLines++; } // end while
                   System.out.println("file has the number of lines: " + numLines);
                   q = numLines;
                   System.out.println("creating the array.");
                   String [][] indexArray = new String[q][];
                   System.out.println("populating the array.");
                   while ( ( INPUT = br2.readLine( ) ) != null ) {
                        n = t++;
                        System.out.println("first array index = " + n);
                        String[] ss = INPUT.split("\\s");
                        for(int i = 0; i < ss.length; i ++)
                                  System.out.println( new String( ss[i] ) );
                                  indexArray[n] = ss[i];
                             } // end for
                        } // end while
         } catch (Exception e)
              {System.out.println("something went wrong in populating the array of length " + q); }}
    private static void processTest() { System.out.println("processed text."); }
    private static void closeResources() {
    try{ br.close();  }catch(IOException ioe){} }

    you haven't sized the 2nd part of the 2d array
    add this line
    String[] ss = INPUT.split("\\s");
    indexArray[n] = new String[ss.length];//<--------------
    for(int i = 0; i < ss.length; i ++)
    but note you have declared indexArray both as a class variable
    private static String [][] indexArray;
    and a variable local to the try/catch block
    String [][] indexArray = new String[q][];
    probably what you want is
    indexArray = new String[q][];

  • Passing global variable values from databse to forms

    I am using forms 6i and database is oracle 9i.
    I am trying to run a form stand alone ( by pressing CTRL-R) without putting it in the application.
    since when this form is placed in the application menu it works fine as it has been passed global variables values from the database .
    now i am trying to run the form without menu and thus i want to pass the values of global variables .please let me know where should i pass these values in form .is it be WHEN-NEW-FORM-Instance trigger or in Pre-form trigger.
    i know what are the global variable values passing into the form from database.
    i can hard code any values to check if the form runs well or not.

    If you intend to do this sort of testing regularly you might want to consider creating a seperate form with a control block which allows entry of the name of the form you want to run, the names of the globals and their values, and do a CALL_FORM.

  • What is the variable that I should pass from page to page?

    Hello,
    I have gotten some code for pagination, and I have gotten it to work for the first page.  However, when I click on the links to the next pages, the results are blank.
    So, apparently the problem is that I am not passing the correct variable to these next pages.
    The problem is that my output that I'm trying to paginate is a little fancy, and it's hard for me to tell what variable to pass from page to page, and whether or not this variable is an array. 
    My output code is below.  This is all kicked off after a user submits a value for the variable "$find" via an HTML form.  What should I use as a variable to pass from page to page?
    Thanks in advance,
    John
    $result=mysql_query("SHOW TABLES FROM sand2 LIKE '%$find%'")
    or die(mysql_error());
    if(mysql_num_rows($result)>0){
    while($table=mysql_fetch_row($result)){
    print "<p class=\"topic\">$table[0]</p>\n";
    $r=mysql_query("SELECT * , votes_up - votes_down AS effective_vote FROM `$table[0]` ORDER BY effective_vote DESC LIMIT $offset, $rowsperpage");
    print "<table class=\"navbar\">\n";
    while($row=mysql_fetch_array($r)){
    print "<tr>";
    print "<td>".'<a href="http://'.$row['site'].'" class="links2">'.$row['site'].'</a>'."</td>";
    print "<td class='votes'>".'<span class="votes_count" id="votes_count'.$row['id'].'">'.number_format($effective_vote).'</span>'."</td>";
    print "<td class='ballot'>".'<span class="button" id="button'.$row['id'].'">'.'<a href="javascript:;" class="cell1" id="'.$row['id'].'">'.Vote.'</a>'.'</span>'."</td>";
    print "</tr>\n";
    print "</table>\n";

    >$result=mysql_query("SHOW TABLES FROM sand2 LIKE '%$find%'")
    >
    >Should it be SELECT * FROM TABLENAME ?
    The OP is searhing the system tables for a user table in a database. With most dbms's you would select from the system table for the object. MySql has the Show command.
    http://dev.mysql.com/doc/refman/5.0/en/show-tables.html

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

  • How to create an array in one field and have another field display certain elements from that array?

    I am making a form in Acrobat XI pro.
    In one text field, I created an array of several elements. I want other text fields to display certain elements from that array. For instance, one field should display the 3rd element, another field should display the 13th element, etc.
    The Javascript for making the array is very long, and so I don't want to have to re-calculate the array every single time (in order to reduce rendering time when I open the form on an iPad). This is why I'd like to only have to create the array once, and simply refer to it throughout the form.

    What code are you using to update the array currently? Are you completely rebuiding it when an element changes, or just changing specific elements for certain fields? I'm still not sure what exactly you are trying to do, but something like this in a document level script will create your array:
    var myArray;
    // Call 'updateArray' to initialize array
    updateArray();
    function updateArray() {
         // Code here to create/update array
         myArray = new Array();
         myArray[0] = "Value 1";
         myArray[1] = "Value 2";
         myArray[2] = "Value 3";
    Then, for each field that needs to update this array, you can add a call to 'updateArray()' in the appropriate event. This will rebuild the array completely; if you just want to update specific elements, then you can access them directly.

Maybe you are looking for

  • Film 2k Editing Project Settings

    Hi, i am starting a film project to edit,can anyone plz give me the exact 2k project sequence settings & project settings,like frame rate,2k resolution size,progressive or ???? ,the project pipeline is - premiere to speedgrade to Lab print(Negative o

  • Post-processing error Template code: ARXCMGJR

    Hi SR 6648071.994 CAP GEMINI ERNST & YOUNG UK PLC ISSUE: Customer is testing for a major upgrade to 11.5.10.2, and receive an error when submitting ARXCMGJR module: On Account Credit Memo Gain and Loss Journal report in post processing of concurrent:

  • Dynamic Select List - XML and umlaut

    Hi, I've recently implement a dynamic select list as per [this thread|http://forums.oracle.com/forums/thread.jspa?threadID=327306], however it seems to break if I have any words containing an umlaut. I've tried setting the header on the Application P

  • Error: There was an error opening this document...

    "There was an error opening this document. The file name, directory name, or volume label syntax is incorrect." I am trying to open a file stored on a web server when I receive this error. If I copy it to the local disk and open it, I do not get the

  • How do i do a mail merge for labels

    I would like to create labels in a Pages document using a Numbers document for the data.  I have it all set up, but upon completing the merge, I get an entire page of the same label (same fields), the next page of labels contains 30 copies of the 2nd