Jump to content

Trying to get a variable into a flsh file through php


tlhoward

Recommended Posts

Ok something is wrong with my code I cant for the life of me figure out how to get the variable first name to pass through to my flash file.

I have loaded the php into flash I can pull the date but for the life of me i cant figure out how to make the first name and last name into vars to pull inside the flash file some help would be greatly appreciated.

 

<?php
include("dbconnect.php");
include("includes/functions.php");
$query = "SELECT * FROM tblannouncements WHERE published='on' ORDER BY date DESC LIMIT 0,3"; 
$result = mysql_query($query);
while ($data = mysql_fetch_array($result)) {

$myfirstname = $clientsdetails["firstname"];
$date = fromMySQLDate($date);

print("&date=$date&annon=$myfirstname");
}
?>

Link to comment
Share on other sites

Sorry correct code I am trying

<?php
include("dbconnect.php");
include("includes/functions.php");
$query = "SELECT * FROM tblannouncements WHERE published='on' ORDER BY date DESC LIMIT 0,3"; 
$result = mysql_query($query);
while ($data = mysql_fetch_array($result)) {
$id = $data["id"];
$date = $data["date"];
$title = $data["title"];
$announcement = $data["announcement"];
$clientdetails = $data["firstname"];
$date = fromMySQLDate($date);
print("&date=$date&annon=$announcement&title=$title&id=$id&firstname=$firstname");
}
?>

Link to comment
Share on other sites

ok update im using this code but for some reason i dont even have to login and it shows the info any help please would be appreciated.

 

<?php
include("dbconnect.php");
include("includes/functions.php");
include("includes/clientareafunctions.php");
$query = "SELECT DISTINCT (tblclients.id) as ID, firstname, lastname , companyname, (SELECT sum( credit ) FROM tblinvoices WHERE userid = tblclients.id) as usedinvoices ,sum( tblclients.credit ) as unused FROM tblclients LEFT JOIN tblcredit ON tblclients.id = tblcredit.clientid GROUP BY id, firstname, lastname, companyname";
$result=mysql_query($query);
$data = mysql_fetch_array($result); while ($data = mysql_fetch_assoc($result)) {
$clientname = $data['firstname'] . "   " . $data['lastname'];
$companyname = $data['companyname'];
print("&firstname=$clientname&companyname=$companyname&finished=1");
}
?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated