Welcome, Guest
  • Author Topic: Anyone had this happen?  (Read 4665 times)

    jack_bbs

    • Server what's that
    • *
    • Posts: 4
      • View Profile
    Anyone had this happen?
    « on: 09/24/07, 14:03 »
    I'm trying to load data from an SQL database for flash to interact with and when I have the code set as:

    "select * from $table WHERE username = 'joe'"

    everything works fine.  However, when I have a form post the name and I assign it a variable (i.e. $user1) and set the code to read like:

    "select * from $table WHERE username = '" . $user1 . "'"

    Flash will not recognize any of the contents from the database.


    I have tested the PHP code and it works fine. It will connect and pull all of the variables out of the database and print them on the page, I just am unable to get flash to read what is printed.

    Any help would be greatly appreciated.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Anyone had this happen?
    « Reply #1 on: 09/24/07, 15:39 »
    How looks the PHP output, is readable by flash (name/value pairs, xml, etc)

    Jorge

    jack_bbs

    • Server what's that
    • *
    • Posts: 4
      • View Profile
    Re: Anyone had this happen?
    « Reply #2 on: 09/24/07, 20:23 »
    Hi Jorge,

    That's one of the weird things...whether it is using the variable $user1 or if I set the username manually the output stays the same

    "&color1=O&color2=P&color3=D&color4=O&color5=G&color6=D&color7=O&color8=P&color9=D&color10=O&color11=G&color12=D&cert1=Jack&cert2=Dillon&bdate=November 13, 1983&bplace=Gainesville, Florida&pw=pass"

    Thanks

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Anyone had this happen?
    « Reply #3 on: 09/25/07, 01:04 »
    If you pass trough POST, to capture should be:

    $_POST['user1']

    Focus on fix your PHP, with different hardcode values should return differents recordsets

    Jorge

    jack_bbs

    • Server what's that
    • *
    • Posts: 4
      • View Profile
    Re: Anyone had this happen?
    « Reply #4 on: 09/25/07, 19:45 »
    Thanks Jorge,

    I may not have worded it right in the previous post, but the output from the DB is not changing whether it is hard-coded or the variable....so I know that part is working right.

    As I have it now, flash is loading the variables with

    loadVariables("file.php","");

    Is it possible that Flash is somehow reading the variables before the PHP user variable is passed and the fields are pulled from the DB?

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Anyone had this happen?
    « Reply #5 on: 09/26/07, 02:15 »
    You should use a LoadVars object, check http://www.flash-db.com/Tutorials/loading/

    Jorge

    jack_bbs

    • Server what's that
    • *
    • Posts: 4
      • View Profile
    Re: Anyone had this happen?
    « Reply #6 on: 09/26/07, 12:18 »
    Will definitely check it out!

    Thanks   :D