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.

Similar Messages

  • Save data to mysql using AS3 + Flash Builder(flex) OR AS3+AMFPHP? or AS3

    Hi,
    i just want to confirm with you guys about saving data to mysql using Action script 3.
    I am now developing RPG game that user can save data again and again to the MySQL.
    I searched on the net and found few solutions:
    AS3 alone using URL Loader
    AS3 + Flex +Php to save data to mysql
    AS3 + AMFPHP to save data to mysql
    This make me confused as there are too many options but i do not know which one is better for me
    or what are their limitations...
    Could you guys help me on this?

    For developing you can use the server (install like any other software), but the Zend framework is nothing more than php files, so all you need to do is upload the framework to you hosting server and all should be well.. You may have to configure a few things, but you should be able to do that yourself.
    There's plenty of documentation on installing and configuring Zend on their website.
    So, only get the server edition if you don't already have a dev server (on you computer) installed, like Apache. Otherwise, just grab the framework:
    http://framework.zend.com/download/latest
    Select "minimal package" on the page above to only get the framework (no install). Or grab both and see what each one does but the minimal package is what you need to upload to your hosting server.
    As for where Flex/Flash Builder comes in.. FB is the tool you use to create a Flash/Flex application.
    Zend, AMFPHP, etc.. is used to communicate with your backend from your application, using RemoteObject
    RemoteObject API
    http://livedocs.adobe.com/flex/3/langref/mx/rpc/remoting/RemoteObject.html
    Using RemoteObject components
    http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html

  • Can I develop CF projects using Flash Builder 4.5 for PHP?

    I currently develop CF projects using Flash Builder 4.5.  I am considering purchasing Flash Builder 4.5 for PHP.  Will I still be able to work on my CF projects using FB for PHP?

    Because in the installation instructions for FB for PHP it says that you have to uninstall the current installation of FB which I have several CF projects that I use regularly.  I hate to uninstall if it turns out that I can't transport my current projects into FB for PHP. 
    Oh that sux!  It's just an Eclipse plug-in, and one can have installed multiple installs of Eclipse OK, so I wonder why they're said this?
    OK, because I give suck advice, I'll D/L it and install it on a spare machine and take a look.  FB usually has a CF perspective does it?  So what you need to know is whether FB for PHP still has the CF perspective?
    Or are you asking whether you can install CFB (or CFEclipse) as a plug-in to FB for PHP, like one can with FB?
    Sorry about the bad advice.
    Adam

  • Email Script only using Flash. Not Using Asp,Php

    Hi,
    Thanks in Advance.
    Hi i want the script mailing directly from flash(swf ) to the
    id where we mention not using any php,asp only using Screenweaver
    Third Party Plugin Any Idea on this ISSue. AnyOne Can Help Kindly.
    Awaiting For your reply mail.
    R.Denesh Kumar
    [email protected]

    Yes there s a third party tool to send mail directly from
    flash. I forgot its name..
    But my Suggestion is to use either ASP/PHP to send mail
    Why BCZ. to send mail u need Net connection. If netconnection
    Exist u can use ASP/PHP. U can access it from your desktop also. So
    Use a ASP/PHP function to send mail.

  • Flash & PHP

    I have created a database that contains mp3 numbered audio
    such as 411.mp3, 412.mp3. However, in Flash, I cannot play the mp3.
    I am using Flash Pro 2004.
    My mp3 audios are located in this folder.
    /media/aduioSermons/audios
    My flash MediaPlayBack that I used from Flash MX 2004 Pro, in
    the parameters tab I had selected mp3 radio button and then in the
    URL this is what has been typed.
    /media/aduioSermons/audios/<?php echo
    $row_rsAudioSermon['listen']; ?>
    The <?php echo $row_rsAudioSermon['listen']; ?> is my
    database in MySQL that stores the name "411.mp3".
    So my plan is to embed one flash file called
    "audioSermonPreview.swf" and inside that SWF has that URL so when
    it is called up in a details page it plays that clip.
    Is this possible to do or there is no way to link them?
    Thank you for all who help.
    AdonaiEchad
    This is my PHP Page

    Hi all_begin,
    here you have to create an another loadvar (which will be the
    return the data in order to you request ) object like to have made
    "var sendMail_lv:LoadVars = new LoadVars();". The newer may be "var
    resultMail_lv:LoadVars = new LoadVars();" and then you have to put
    this "resultMail_lv" in "sendAndLoad" method of flash like :
    sendMAil_lv.sendAndLoad(
    http://PATHtoMYserver/sendMail.php",
    resultMail_lv "POST");.
    Now, you have to write bit of code in your send_btn.onRelease
    function to load data that you want to get from your php file.
    resultMail_lv.onLoad = function(success:Boolean) {
    if (success) {
    result_ta.text = resultMail_lv.welcomeMessage;
    } else {
    result_ta.text = "Error connecting to server.";
    here " result_ta " will be the text area in which you can
    show the data which is cominig from your php side.

  • How well does Flash & PHP mix?

    I haven't worked much with forms yet in Flash. The existing
    site that I'm replacing with a flash site uses some PHP to interact
    with a MySQL database. It is for an email list that users can
    sign-up for or remove themselves. I'm wondering if I will be able
    to still (at least somewhat easily) do the same thing through
    Flash. Here's the code currently used:
    <?php
    switch ($_GET['a']) {
    case "s":subscribe();break;
    case "r":remove();break;
    default: subscribe();
    function subscribe() {
    require_once 'database.php';
    require_once 'admin/lib.php';
    $db = new Database('eaglebro_lists');
    $show_form = true;
    if ($_POST) {
    if (is_email($_POST['email'])) {
    $email = format_email($_POST['email']);
    $uniqid = make_uniqid();
    $db->query("REPLACE users (name, email, uniqid, created)
    VALUES ('$_POST[name]','$email','$uniqid',NOW()) ");
    $id = mysql_insert_id($db->db);
    $db->query("REPLACE subscriptions (listid, userid,
    created) VALUES ('11','$id',NOW()) ");
    $show_form = false;
    echo '<h3>Success!</h3><p>Thank you for
    subscribing to the Route 212 email newsletter!</p><hr
    /><p><a href="/">Route 212 Home
    Page</a></p>';
    } else {
    echo "<h3>Error!</h3><p>The email address
    you entered appears to be invalid. Check for any errors and submit
    the form again.</p><hr />";
    if ($show_form == true) {
    ?>
    <p>Sign up to receive periodic email about Route 212
    events and news.</p>
    <form method="post"
    action="/interact/updates.html?a=s">
    <p>
    <label class="m"
    for="f_name">Name:</label><input id="f_name"
    type="text" class="text m" name="name" />
    <label class="m"
    for="f_email">Email:</label><input id="f_email"
    type="text" class="text m" name="email" />
    <p><input id="f_submit" type="submit" class="button
    s" value="Subscribe" /></p>
    </form>
    <?php
    function remove() {
    require_once 'database.php';
    $db = new Database('eaglebro_lists');
    //if email address is provided
    if ($_GET['uid'] && $_GET['lid']) {
    //perform database removal and show confirmation
    $id = $db->query_fetch("SELECT id FROM users WHERE
    uniqid='$_GET[uid]'");
    $db->query("SELECT * FROM subscriptions WHERE
    userid='$id[id]' AND listid='$_GET[lid]'");
    if (mysql_num_rows($db->result)) {
    $db->query("DELETE FROM subscriptions WHERE
    userid='$id[id]' AND listid='$_GET[lid]'");
    $list = $db->query_fetch("SELECT name FROM lists WHERE
    id='$_GET[lid]'");
    echo "<h4>Unsubscription
    Successful</h4><p>You have been removed from the
    following list: <b>$list[name]</b></p>";
    echo '<hr /><p><a href="/">Route 212 Home
    Page</a></p>';
    } else {
    $list = $db->query_fetch("SELECT name FROM lists WHERE
    id='$_GET[lid]'");
    echo "<h4>Cannot Unsubscribe</h4><p>You
    have either already unsubscribed from the following list:
    <b>$list[name]</b>, or an
    error has occured.</p>";
    echo '<hr /><p><a href="/">Route 212 Home
    Page</a></p>';
    } else {
    echo "<h4>Cannot Unsubscribe</h4><p>There
    is information missing.</p>";
    echo '<hr /><p><a href="/">Route 212 Home
    Page</a></p>';
    ?>

    Josh,
    I'm much more comfortable with PHP that Flash too. You won't
    have a problem getting the two to work together. Its pretty easy
    actually.
    The key in my limited experience is to have your PHP to run
    as normal and then communicate what you want to display to the user
    via one of Flash's external data connection classes. There is a
    great chapter on this in the book "flash 8 action script" by Adobe
    --- the easiest way is to just use the "loadVars" class to accept a
    string you've generated as output of your PHP file in the format:
    &variable = data &variable = data etc...
    Also here is a good site with an example I've found that was
    helpful in getting the two languages to work together:
    http://webmonkey.wired.com/webmonkey/03/40/index0a_page3.html?tw=programming
    This example actually walks you through the communication
    between all 3 --> MySQL, PHP and Flash.
    Good luck!!
    Tom

  • How to create Theme SWC using Flash Builder 4

    I have created a library project in flex which contains spark skin classes for certain controls and a style sheet class. The problem is when I use the SWC generated by thsi project  and import this SWC as Theme and apply it to another test project. the stylings chasnges are not reflected.
    IF I use comand line to generate Theme SWC the changes are reflected.
    Can any one help me use FLash Builder to create and apply theme SWC.

    Connect to PHP in FB4 is used when you have a PHP Class and you want to use that in FB, for example Employee.php and it has a Employee class and various methods in that like create, update, get, delete.
    However, if you have exposed your functionality in PHP as a HTTP URL (i.e. it is not a class), then you should be using HTTPService from the data menu.
    So if your file is login.php and is accessible as a URL, then using the HTTPService and enter the URL.
    Does this help?
    -Sunil

  • How to Upload a File using FileReference + PHP??

    How to Upload a File using FileReference + PHP??
    If you could help me with a two code examples the AS code and
    the PHP code of a working example.
    Thanks
    Jorge

    http://www.flash-db.com/Tutorials/upload/upFiles.php?page=1

  • Cannot connect from dreamweaver cs5.5 to mysql using the mysql connection wizard

    Cannot connect from dreamweaver cs5.5 to mysql using the mysql connection wizard error Http error 403 or 500 internal server error. I am using ubuntu mysql.
    a manual php script work fine
    <?php
    // open connection to mysql server
    $dbc = mysql_connect('localhost','root','password');
    if (!$dbc) {
                die('Not Connected' . mysql_error ());
    //select database
    $db_selected = mysql_select_db ("msinventory",$dbc);
    if (!$db_selected)
            die('Cannot Connect' . mysql_error());
    echo "TEST DONE1";
    ?>
    but the database connection wizard fails with http error 403 or 500
    i also use the HeidiSQL client and it works, the only problem is in dreamweaver.

    OK.  Did you really mean to ask this question on a ColdFusion forum, if it's DreamWeaver you're having problems with?  You're probably better off raising this on a DreamWeaver forum.  "Using the correct tool for the job" 'n'all.
    Adam

  • I use a Flexislider for my website [url removed] I want to use flash and make my website attracti

    I use a Flexislider for my website [url removed] I want to use flash and make my website attractive. Any suggestions?

    Will people be able to login to the FTP server from my website and do everything through their browser?
    Users could use web based ftp client or a 3rd party ftp client.
    Have look at the sytem the following school uses.
    http://www.glenbard.net/Glenbard_DistrictHQ/Media/MOVs/Web-BasedFTPClient.html
    Although I have not setup this type of thing up myself googling around shows a few tutorials using PHP or Java based ftp clients.
    have a look at this article..

  • Re-sizing, align right while keeping the menu fixed using flash AS2

    contact
    khuon
    mau
    My problem is recreating the align right effect while keeping
    the menu fixed using flash AS2 mostly for re sizing as well as
    different screen sizes.
    While i can do one or the other but both is just not
    happening.
    I have tried all sorts of weird and wonderful things but as
    yet, alas no easy/simple solution :(
    I must admit it has been a long time since i have been here
    but.. I thought if someone could have a quick look and maybe please
    give me a few pointers ??
    Anything at all would be better than what i have now ...
    Thanks for your time

    The link again is I forgot to add http to the link before, but it should have worked.
    http://www.lipowiec.org/test/index.php
    a) used Dreamweaver to create new site selected 1 column, elastic, centered, header, and footer
    b) used spry to add horizontal menu to header
    c) followed instructions from Spry Help
    http://livedocs.adobe.com/en_US/Spry/SDG/index.html?lang=en_US ->
    working with spry widgets -> working with the menu bar widget -> Customize the dimension of menu items as indicated
    To change the dimension of menu items by changing the width properties of the menu item’s li and ul tags.
    Locate the ul.MenuBarVertical li or ul.MenuBarHorizontal li rule.
    Change the width property to a desired width, or change the property to auto to remove a fixed width, and add the property and value white-space: nowrap; to the rule.
    Locate the ul.MenuBarVertical ul or ul.MenuBarHorizontal ul rule.
    Change the width property to a desired width (or change the property to auto to remove a fixed width).
    Locate the ul.MenuBarVertical ul li or ul.MenuBarHorizontal ul li rule.
    Add the following properties to the rule: float: none; and background-color: transparent;.
    Delete the width: 8.2em; property and value.
    Under IE it's broken, under the other browsers it works.
    There need to be more IE HACKS added.

  • Dreamweaver & MySQL Extension for PHP

    Hey guys,
    As everybody knows, the mysql extension in PHP has been deprecated and it will soon be replaced by mysqli, so does anybody know where I can find an Adobe Extension I can use so I can start using mysqli with Dreamweaver instead of mysql?
    By the way, I'm using CS5, CS5.5, so I don't have access to exchange since Adobe put it to work only with CS6.
    Thanks

    PHSTechSupport wrote:
    Hey guys,
    As everybody knows, the mysql extension in PHP has been deprecated and it will soon be replaced by mysqli, so does anybody know where I can find an Adobe Extension I can use so I can start using mysqli with Dreamweaver instead of mysql?
    By the way, I'm using CS5, CS5.5, so I don't have access to exchange since Adobe put it to work only with CS6.
    Thanks
    Unfortunately there is no extention available at the moment which replaces the old/current msql server behaviours in DW for msqli. Whilst they are/were useful they are/were also were quite limiting.
    After Adobe announced that they would be removing the server behaviors in the current version of DW CC and that php announced that it would no longer support the sql extention in it's next release personally I decided it was time to move on. The good news is using sqli to connect/query a database is really quite a simple proceedure. Just Google a few tutorials.
    I understand the reasoning for wanting sqli automation BUT its not available at the moment so you have two choices, 1) continue to use the old mysql server behaviours or 2) learn the new sqli way. It wont take you long to get to grips with it. The server behaviours in DW only offered the basics so learning those basics using sqli isn't going to be too time consuming, plus you actually get more familar with the coding.

  • Using Flash with Facebook Connect

    I was wondering if anyone has any information or resources on using Flash AS3 with facebook connect.  What I'm particularly looking for is how to do facebook authentication within the flash interface (so the user doesn't need to exit to the facebook website to connect) and also if there are any ways to make facebook calls from within flash once you have authenticated (rather than loading xml generated in PHP as I am currently doing).
    Any information or resources would be appreciated.

    The dial in process would be exactly the same as if you were dialing into the bridge as a participant. Most of the time it needs the following steps.
    Phone number:           800-555-5555
    Delay:                        3000 ms
    DTMF: (passcode)     123456#
    Delay:                        3000ms
    DTMF:                      1 or # (for a roll call or to join the bridge)
    However if the provider is not using a SIP compliant bridge, the Universal Voice tool will fail upon attempting to dial out.
    Also, for the hosted environment, the phone bridge must have a toll-free number.

  • Is SWFOBject messing up my Flash/PHP 'contact form'?

    Hi all,
    First post, and first project using Flash!
    Here's the
    page I'm having problems with...
    It's an email contact page that uses a Flash contact form
    that I purchased from iStockphoto. The swf uses a PHP script that I
    keep in the same location on my server as the swf. The PHP sends
    the email to my specified address. In theory that should work fine,
    but in the interests of keeping things working across browsers, and
    maintaining my Validation, I've been calling the swf using
    SWFObject.
    However, something is screwed up. When I click on 'Send' on
    the successfully embedded Flash form, nothing happens. Neither my
    hosting providers nor the author of the flash have been able to
    work out why - although they both agree that SWFObject may have
    something to do with it.
    Please bear in mind that I'm REALLY new to Flash, although
    I'm by no means a technonewbie - tell me what I'm looking for and
    what to change and I can keep up, but someone posted the following
    on another forum I frequent and I have no idea what it means:
    quote:
    Submitting a form relies on either a post or get method,
    maybe SWFObject needs specific configuration to do this. If it
    doesn't support either of those two methods you may need to use an
    interim piece of javascript or something to accept the form
    variables then call your sendmail.
    Help much appreciated!
    Owen

    kglad,
    The actionscript calls the PHP form but dosen't post any information, it loads in the browser and I get the email but nothing in it?
    I'm just looking for the correct Actionscript to paste into flash and hopefully get it working. Thanks for the help.

  • Debugging online: can't use flash ide

    I have a working website online with mysql database.
    My flash app starts there so I can't debug games locally.
    What debugging tool can I use - monster 3 - just seen it - is that a good option?
    Also it looks like you can use monster locally - what's wrong with the flash debugging tools???

    Isn-t flash builder for flex development / I only use flash professional cs4 and I don-t know anything about flex
    Date: Sun, 24 Apr 2011 11:01:09 -0600
    From: [email protected]
    To: [email protected]
    Subject: debugging online: can't use flash ide
    I run Flash Builder all day debugging on my localhost. Works great.
    >

Maybe you are looking for

  • Prblm in Date format when exported to excel

    Hi , I had a problem when using the Export To Excel option from Portal. The data is getting fine populated in Excel but it's in General No Specific Format. But I wanted the data to be in its original format even when exported to Excel. Like... Countr

  • Error in Work order -IW31

    Hello All, We are facing one error while creating work order. When we are creating work order from IH01 > Goto> Create order or directly creating from IW31 by putting PM03 in type , priority and equipment details then after release if we press save b

  • Attendance Management Of Employees in SharePoint 2010

    Hi,    I have a text file which consists of almost 1129 items of Employee id, Name, In/Out, Date and time fields. How do i insert such a huge raw data into SharePoint List so that i can get total duration of hours worked by calculating the Check In a

  • Session in the servlet

    Hi! A Netbeans web application use some servlets, not jsp, and tomcat, and postgre sql. The big problem is executing some querry after the jdbc connection was closed, or can't open a new jdbc connection because too many are open, for example. And the

  • NAFTA Revoke functionality

    Hi There, I have one doubt in NAFTA revoke functionality. Scenario 1: Material was positive in the LTVD we issued; now the status is changed to negative. The original LTVD has to be cancelled. It is done via revoke functionality. This is working fine