A little nudge, please...

Hi, I need to run a query and convert the results to an XML
string. I *think* I need to do all of this in PHP but I wanted to
get some guidance as sometimes I make things more difficult than
necessary.
Do I have 2 scripts... one to query and one to process the
results to XML? Or can I put them both in the same script. To do
the latter is not proper OOP practice, correct?
Once that is done, I can get the data into Flash. I need it
to be XML though because the same data is being used elsewhere
outside of Flash.
Is this the proper, most efficient way of handling this
task?

"Do I have 2 scripts... one to query and one to process the
results to XML? "
Your call, it would depend on how you want to manage and
construct your PHP code.
"To do the latter is not proper OOP practice, correct?" If it
is a simple project, do on all one PHP script. If the project has
certain potential of expanding greatly and the code could be
reusable in other needs, then looking at how to decompose the
script functionality and data is merited.
As for Flash it depends on the version of AS.
For AS2 you use the XML class and in particular the
XML.sendAndLoad
method.
There are many examples by searching Google. Here are two I
posted:
Listing
MySQL Database Table Using PHP, XML and DataGrid Component
Login
User Authentication Example Using MySQL, PHP, XML

Similar Messages

  • Little help please with forwarding traffic to proxy server!

    hi all, little help please with this error message
    i got this when i ran my code and requested only the home page of the google at my client side !!
    GET / HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
    Accept-Language: en-us
    UA-CPU: x86
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727)
    Host: www.google.com
    Connection: Keep-Alive
    Cookie: PREF=ID=a21457942a93fc67:TB=2:TM=1212883502:LM=1213187620:GM=1:S=H1BYeDQt9622ONKF
    HTTP/1.0 200 OK
    Cache-Control: private, max-age=0
    Date: Fri, 20 Jun 2008 22:43:15 GMT
    Expires: -1
    Content-Type: text/html; charset=UTF-8
    Content-Encoding: gzip
    Server: gws
    Content-Length: 2649
    X-Cache: MISS from linux-e6p8
    X-Cache-Lookup: MISS from linux-e6p8:3128
    Via: 1.0
    Connection: keep-alive
    GET /8SE/11?MI=32d919696b43409cb90ec369fe7aab75&LV=3.1.0.146&AG=T14050&IS=0000&TE=1&TV=tmen-us%7Cts20080620224324%7Crf0%7Csq38%7Cwi133526%7Ceuhttp%3A%2F%2Fwww.google.com%2F HTTP/1.1
    User-Agent: MSN_SL/3.1 Microsoft-Windows/5.1
    Host: g.ceipmsn.com
    HTTP/1.0 403 Forbidden
    Server: squid/2.6.STABLE5
    Date: Sat, 21 Jun 2008 01:46:26 GMT
    Content-Type: text/html
    Content-Length: 1066
    Expires: Sat, 21 Jun 2008 01:46:26 GMT
    X-Squid-Error: ERR_ACCESS_DENIED 0
    X-Cache: MISS from linux-e6p8
    X-Cache-Lookup: NONE from linux-e6p8:3128
    Via: 1.0
    Connection: close
    java.net.SocketException: Broken pipe // this is the error message
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:115)
    at java.io.DataOutputStream.writeBytes(DataOutputStream.java:259)
    at SimpleHttpHandler.run(Test77.java:61)
    at java.lang.Thread.run(Thread.java:595)
    at Test77.main(Test77.java:13)

    please could just tell me what is wrong with my code ! this is the last idea in my G.p and am havin difficulties with that cuz this is the first time dealin with java :( the purpose of my code to forward the http traffic from client to Squid server ( proxy server ) then forward the response from squid server to the clients !
    thanx a lot,
    this is my code :
    import java.io.*;
    import java.net.*;
    public class Test7 {
    public static void main(String[] args) {
    try {
    ServerSocket serverSocket = new ServerSocket(1416);
    while(true){
    System.out.println("Waiting for request");
    Socket socket = serverSocket.accept();
    new Thread(new SimpleHttpHandler(socket)).run();
    socket.close();
    catch (Exception e) {
    e.printStackTrace();
    class SimpleHttpHandler implements Runnable{
    private final static String CLRF = "\r\n";
    private Socket client;
    private DataOutputStream writer;
    private DataOutputStream writer2;
    private BufferedReader reader;
    private BufferedReader reader2;
    public SimpleHttpHandler(Socket client){
    this.client = client;
    public void run(){
    try{
    this.reader = new BufferedReader(
    new InputStreamReader(
    this.client.getInputStream()
    InetAddress ipp=InetAddress.getByName("192.168.6.29"); \\ my squid server
    System.out.println(ipp);
    StringBuffer buffer = new StringBuffer();
    Socket ss=new Socket(ipp,3128);
    this.writer= new DataOutputStream(ss.getOutputStream());
    writer.writeBytes(this.read());
    this.reader2 = new BufferedReader(
    new InputStreamReader(
    ss.getInputStream()
    this.writer2= new DataOutputStream(this.client.getOutputStream());
    writer2.writeBytes(this.read2());
    this.writer2.close();
    this.writer.close();
    this.reader.close();
    this.reader2.close();
    this.client.close();
    catch(Exception e){
    e.printStackTrace();
    private String read() throws IOException{
    String in = "";
    StringBuffer buffer = new StringBuffer();
    while(!(in = this.reader.readLine()).trim().equals("")){
    buffer.append(in + "\n");
    buffer.append(in + "\n");
    System.out.println(buffer.toString());
    return buffer.toString();
    private String read2() throws IOException{
    String in = "";
    StringBuffer buffer = new StringBuffer();
    while(!(in = this.reader2.readLine()).trim().equals("")){
    buffer.append(in + "\n");
    System.out.println(buffer.toString());
    return buffer.toString();
    Edited by: Tareq85 on Jun 20, 2008 5:22 PM

  • Need a little help please    Airport Express

    Need a little help please.
    I am trying to set up a wireless network at my home using Airport Express.
    I have a regular phone line running in to I assume the modem. From there, there is an Ethernet cable running from that box to the back of the PC. My question is, I think, which of those do I unplug and plug into the Airport Express, the one on the back of the PC or the one that is in the back of the modem, or is this totally wrong.
    Any help would be appreciated…
    Thanks
    In advance…
    PS I have the manual but to me it is not very clear…

    Your connection sequence would look like this:
    Internet > Modem > AirPort Express >>>wireless to your computers.
    This means that you would unplug the cable that is now connected at the back of your PC and move that connection to the AirPort Express.
    Open Macintosh HD > Applications > Utilities > AirPort Utility
    Click Continue to follow the guided setup. On the third page, you will choose the option to "Create a wireless network" and continue the setup.

  • Guys, a little help please ???

    Guys, a little help please before i launch my new toys out of my pram   I've got the new apple TV, Ipad2, and IOS5 update. I'm trying to set up mirrorring , however, when i double click the home page and swipe, the only options it gives me are Ipad or Apple TV. The video shows that i should be able to simply click on mirrorring and whazam it appears on my TV... I can't get this option.... I've rebooted them (router, ipad 2 and Apple Tv) numerous times but still can't get it.......Can someone tell me what I'm doing wrong?
    Thanks

    Sounds as though the options you're getting are the standard Airplay output icons.
    Check current AppleTV software version in Settings>General>About
    Latest is 4.4.2 - there's a sticky at the top of the page about updating - if you're on 4.3 or lower just update from Settings.
    Maybe someone can confirm the video you mention is actually the correct way to invoke mirroring - link?
    (Yn anfodus heb iPad2 does dim syniad 'da fi os ydi'r Mirroring yn gweithio fel yn y fideo - oes linc i'r fideo, rhag ofn bod y fideo'n anghywir?)
    AC

  • I have iPhone 4.I uprage it to IOS 5.1.1 and i can't go into it because i have no service.A  little help,please ? :/, I have iPhone 4.I uprage it to IOS 5.1.1 and i can't go into it because i have no service.A  little help,please ? :/

    I have iPhone 4.I uprage it to IOS 5.1.1 and i can't go into it because i have no service.A  little help,please ? :/, I have iPhone 4.I uprage it to IOS 5.1.1 and i can't go into it because i have no service.A  little help,please ? :/

    Your phone is carrier locked to a carrier other than the one you are trying to use.
    It was apparently hacked to unlock it prior to your attempt to update. Updating has re-locked it to the original carrier.
    Contact them and find out what their policy is.

  • HT1918 a little help please...

    Hello!I have a question!I upgraded my iTunes today and now I have Itunes 5.1.1.Before that I just had to give a password and nothing else in order to download an app from iTunes.Now I am a little complicated.I'm trying to create a new account and I don't have a credit card.But there is no ''none'' option!I only download free apps and I'm not interested in buying anything.I tried to change the country option and the ''none'' option appeared!But now I don't know what this '' to redeem a code or gift certificate'' is.And I don't know what to do in order to continue...Could you please help me?

    Again sad, no replies -

  • Virus Alert For You All,and a little advice please

    Greetings iPOD Peepz,havin Fun i hope.i've been recieving little v's, and a small worm periodicly when opening Music Store,BE WARNED,i'ts a sneeky cretin,and likes hide&seek.its Favourite Place to HiDE is in JAVAINSTALL FILES.I'm now quite sure it comes from adverts at apple that appear when openin there sites,but which specific advert,???,i'll let you know. any1 know 4DEFO,if REAL-PLAYER supports iPOD MiNi,without any probs occurin on the D-Top,or the iPOD itself.Happy listening U CrazyCaTs

    HELLO SAUSAGE,thanks 4 ya reply.you'll be pleased to know that REALPLAYER does support IPOD,infact not only does it support it,i wud recomend using it instead of Itunes,i say this because its realy easy to manage files and playlists,and you can transfer playlists from ipod to realplayer,which if ya not aware is a pain in the *** to do in itunes.SERIOUSLY try realplayer its alot smarter than itunes

  • A little info please...

    Can someone who has a iMac with the Intel Core 2 Duo please write a little review on it for me, a couple of sentences I am deciding wether to get another Dell or an iMac, my grandson tells me and I quote "PCs are crap and unreliable, get an Mac they're much better, check out the iMac online"
    Thanks!

    Do a Google search. Plenty has already been written about the Intel Macs. You will also find articles at MacWorld.com.
    These discussions are intended to provide user-to-user technical support for Apple products. This is not the proper venue for product reviews.
    You can also explore all the features and specifications at Apple's Online Store.
    HAPPY HOLIDAYS!
    Kappy

  • Switching from external Email server to Exchange, Understanding Dis-Joint, and a little help please

    I'm pretty new at installing exchange myself and have never done Exchange 2013
    While going through the install help online I came across disjointed domains. I think I'm over thinking this but here is what I have and what I want to do. Any other tips would be great as well. 
    Customer currently has a domain, internal dns and email through GoDaddy. Lets call it smallschool.com 
    Internally they have a new Active Directory (2012) and the domain is in.smallschool.com. There is no external DNS except GoDaddy. I plan to use that (if that's ok). 
    I have built a Hyper-V for Exchange 2013 and have installed pre-requisites. 
    My Current Question are...
    Do I need to set up dis-joint dns suffix and modify the msds-allowdnssuffix attribute? I have the instructions, I just don't know if this is a must or not with the domain names like they are.
    Am I going to run into any trouble switching GoDaddy's email to Exchange Server? Any Tips?
    Thank You, 
    fixitrod

    Hi fixitrod,
    Agree with Ed Crowley. If your original used domain is smallschool.com in GoDaddy, I suppose your email address would be
    [email protected]
    If that is the case, when you deployed a new AD domain with in.smallschool.com, we can create an accepted domain for smallschool.com in Exchange 2013. If you want to still use Godaddy for external message sending and receiving, you can create an external
    relay domain. For more information about configuring external relay fomain, please refer to:
    http://technet.microsoft.com/en-us/library/jj657491(v=exchg.150).aspx
    Regards,
    Winnie Liang
    TechNet Community Support

  • Little help please regarding deleting files and folders...

    My wife has a MBP and has accumulated some old items in her documents folder that she'd like to delete. She has a USB mouse but the "right click" doesn't appear to work. She's running 10.4.11 and can't reveal the files in icon mode to facilitate dragging to trash. Certainly there is a sequence of keystroke commands that will allow these files to be effectively trashed, but our "control/delete", or "apple/delete", or "option/delete" doesn't do the trick after highlighting the subject file. Help please! TIA!

    To delete a file or folder, high light it then using the keyboard type Command Delete and that will delete it. If you have multiple files and/or folders the same keyboard commands apply.
    Regards,
    Roger

  • Can't use google. Little help please

    For some reason I cannot use Google as a search engine or access its website. Would really like to resolve this. Any help is really appreciated.
    Things I have tried:
    1.) Ping google and it was successful
    The address it is using is 173.194.117.242
    To make things weird, if I use this numerical address in the search cue I in fact get access to the google website
    2.) I flushed the DNS in "Terminal"
    Not sure if that did anything. I read somewhere to try it
    Important background information
    When I enter google in my search function, I am directed to this page strangely http://122.132.196.148/33407BMULZ/dsawfffs.php?64198
    I do live in South Korea so that's why its in Korean. Basically it tells me I need to update google chrome (which I am not even using) or download some binary patch that really only is meant for Microsoft users so it doesn't work on my computer anyway.
    So...Why is it that I can reach 173.194.117.242 (google) but then am directed to that strange web page in korean when I use google as a search engine in my browser (firefox,safari)
    Thanks!

    Please review the options below to determine which method is best to remove the Adware installed on your computer.
    The Easy, safe, effective method:
    http://www.adwaremedic.com/index.php
    If you are comfortable doing manual file removals use the somewhat more difficult method:
    http://support.apple.com/en-us/HT203987
    Also read the articles below to be more prepared for the next time there is an issue on your computer.
    https://discussions.apple.com/docs/DOC-7471
    https://discussions.apple.com/docs/DOC-8071
    http://www.thesafemac.com/tech-support-scam-pop-ups/

  • A little help please. Switch statement?

    Well hey there,
    I have some code and I would like to know why it keeps skipping to a certain part.
    I have made code for a cinema booking system and ticket prices are;
    Adult £5
    Student £4
    Child £3
    But no matter which I choose the price is £5?
                                            if ((input1 != null) && (input1.length() > 0)){
                                                char choice;
                                                choice = input1.toLowerCase().charAt(0);
                                                int selectedprice;
                                                switch(choice){
                                                    case 'a':
                                                        selectedprice = 5;
                                                    case 's':
                                                        selectedprice = 4;
                                                    case 'c':
                                                        selectedprice = 3;
                                                    default: selectedprice = 5;I know I have a default price of £5 but how can I make it so there is no default and it goes on what the user chooses? Thanks.

    if ((string2 != null) && (string1.length() > 0)){
                            Object[] possibilities3 = {"Adult", "Student", "Child"};
                                    String input1 = (String)JOptionPane.showInputDialog(
                                            frame, "Please Select Ticket Type: ",
                                            "Ticket Booking", JOptionPane.PLAIN_MESSAGE, null, possibilities3, "" );
                                            if ((input1 != null) && (input1.length() > 0)){
                                                char choice;
                                                choice = input1.toLowerCase().charAt(0);
                                                int selectedprice;
                                                switch(choice){
                                                    case 'A':
                                                        selectedprice = 5; 
                                                        break;
                                                    case 'S':
                                                        selectedprice = 4;
                                                        break;
                                                    case 'C':
                                                        selectedprice = 3;
                                                        break;
                                                    default: selectedprice = 0;
                                                 String input2 = JOptionPane.showInputDialog(frame, "Please Enter Number of Tickets: ");
                                                 Integer quantity = Integer.parseInt(input2);
                                                 TicketPrice total = new TicketPrice(selectedprice, quantity);
                                                 if ((input2 != null) && (quantity <= screen1.getCapacity()) ){
                                                     JOptionPane.showMessageDialog(frame, "Booking Confirmed! Payment of £" + total.getTotal() + " Transacted");
                                                 else if ((input2 != null) && (quantity > screen1.getCapacity()) ){
                                                     JOptionPane.showMessageDialog(frame, "Booking Not Possible");
                                                 else if ((input2 != null) && (quantity > screen3.getCapacity()) ){
                                                     JOptionPane.showMessageDialog(frame, "Booking Not Possible!");This is most of the code, it always says the price is £5 for any ticket? Please help.
    Edited by: sabertoothed.tiger on Dec 10, 2008 4:56 PM

  • SpellChecker Program - A little help please?

    Follwing is a spell checker program I've written. It reads from dictionary file(of correct words) and a user input file. The user input is compared against the contents of the dic file. If they do not match, incorrect words are outputted to the console window.
    The code compiles, but for some reason it is not recognizing my input files (i.e. receive "FileNotFoundError" exception.
    Anyone know why?
    Thanks!!
    import java.io.*;
    import java.util.StringTokenizer;
    public class SpellChecker
        private String inFileName;
        private String dictionaryFile;
        public SpellChecker(String aFilename, String aDictionary)
            inFileName = aFilename;
            dictionaryFile = aDictionary;
            File inFile = new File(inFileName);
            File dictFile = new File(dictionaryFile);
            String inputLine;
            String dicLine;
            StringTokenizer tokenizer;
            String token;
        try
            FileReader inReader = new FileReader(inFile);
            FileReader dicReader = new FileReader(dictFile);
            BufferedReader in = new BufferedReader(inReader);
            BufferedReader dicBuffer = new BufferedReader(dicReader);
            while(in.readLine() != null)
              inputLine = in.readLine();
              dicLine = dicBuffer.readLine();
              tokenizer = new StringTokenizer(inputLine);
              while(tokenizer.hasMoreTokens())
                token = tokenizer.nextToken();
                if(token.equals(dicLine) == false)
                  System.out.println(token);
        catch(FileNotFoundException fnf)
          System.out.println("You must enter an input file name.");
        catch(IOException e)
          System.out.println("Micellaneous IO Exception.");
          public static void main(String[] args)
          try
            String dicFile;
            String checkFile;
            BufferedReader buffread = new BufferedReader(new InputStreamReader(System.in));
            System.out.println("Please enter a dictionary file name");
            dicFile = buffread.readLine();
            System.out.println("Please enter name of file to be checked");
            checkFile = buffread.readLine();
            SpellChecker sc = new SpellChecker(checkFile,dicFile);
        catch(IOException e)
          System.out.println("Micellaneous IO Exception.");
    }

    Thanks!! Now I don't get the same error, but am getting a NullPointerException in 2 places.
    - in main() where I'm creating the SpellChecker object.
    - further up in while loop where I'm creating a StringTokenizer object with the "inputLine" value as a parameter.
    any ideas??

  • Deleting sparsebundle (a little help please)

    i am trying to figure out which of the Great Pondini articles applies to my situation and i seem to be a little low blood sugar or something.
    i have a Time Capsule that i am currently using to backup my MacBookPro LAPTOP using Wifi. this TC is connnected via ethernet to my Mac Pro.
    when i get into the Data folder on this device i see:
    My's Mac Pro.sparsebundle and
    My's MacBook Pro's.sparsebundle
    can anyone tell me the best way to delete the MAC PRO sparsebundle? should i simply open this by doing a show contents from Finder on my MAC PRO and delete the files in there 100 or 200 at a time?
    TIA

    When you select erase in the airport utility there are several options.
    Never do anything but quick erase or a single pass zero out.. the former takes about 1min on any size hard disk.. the single pass zero out took 4-5hours on a 1TB disk I just did .. because I wanted to test and make sure the disk was really ok. The 35-pass options would take months.. I understand if you use a TC to store nuclear launch codes that you might need to zero the drive 20-50 times.. but putting an ax through the drive would work better.
    i see there is a red circular "1" next to the TC in Airport Utility and i guess i can find this error message somewhere if i click in the right spot.
    but as importantly, do i just click on the TC (all the buttons are green) then click on Edit when the dialog comes up - then click on DISKS and then click on the ERASE button?
    Yes, wave the mouse pointer over the dot and the errors should list.
    Yes, open the edit and go to the disk page.. then erase button.
    Bob has done the screen shots in one of his posts for v6 utility.
    To his usual excellent standard.
    https://discussions.apple.com/thread/4865906?tstart=0

  • Just a Little Humor, Please?

    I installed Yosemite on my iMac, recently.  As far-as _I_ can tell Mac OS X v10.10 works as-promised.  :-)
    About its name, I _like_ to think:  Yose-Mite, as 2 separate words.  What can I say?  I break things down, well!  :-)
    I may as-well brag a little:  I live hard-wired to the Internet.  SpeedofMe just-listed my speed of Upload as 2.17 Mb/s & my speed of Download as 6.29 Mb/s.  :-), I think.
    As-is usual, I invite your comments.  Thank you.

    This is probably very simple.
    How do you take the text from a textfield in one class
    and set it to another textfield in another class when
    a button is pressed in the first class.Yup:
    class one:
    in it's constructor, or in a method, make an argument a Textfield.
    Create class two first, use 'getter' method. If a third class (main)
    exists..have it add two's textfield to one..
    //method in one
    public void addTextfield(TextField tf)
    {this.tf=tf;}class two:
    //method in two
    public TextField getTextField()
    //return a TextField
    }In class one:
    -implement ActionListener.
    -mybutton.addActionListener(this);
    //again, class one
    public void actionPerformed(ActionEvent ae)
    if (ae.getSource()==mybutton)
    tf.setText(mytextfield.getText());
    }Simple, right?

Maybe you are looking for

  • Credit management how to block amount on particular sales order

    hi, Client want to block amount on sales order. If customer is having credit limit of 100000 n there are 3 sales order , sales order 1 amount is 50000,sales order 2 amount is 30000 and sales order 3 amount is 40000... Now customer is coming n saying

  • Playing cd's in iTunes. Glitch.

    Hello, when I insert a cd in my computer, and try to play it with iTunes, it always skips when I either just clicked to play it, selected the next track, or jumped a bit in a song. This is making it pretty much impossible to sit back, relax, and play

  • No sound, explorer.exe not starting, no event viewer

    I set up a new PC recently and installed Windows 7 Pro. Approximately once every few days I get a problem which, oddly, has several seemingly different manifestations. I mean that if I see one of these, all the others can be observed as well, until I

  • How to keep field as mandatory in function module

    I have one field in import parameter can you please suggest how to keep it as mandatory Thnx

  • Flex Widget in Acrobat 9 access xml file

    Hi, I made a Flex application which accesses an xml file on my pc. When I insert the application in Acrobat 9, the data in the xml isn't loaded. I think that the Flash player in Acrobat 9 can't access the xml due to security reasons. Embedding the xm