Displaying Multiple Fields In One Flash TextBox

Hey guys,

Jubba was kind enough to help me with this last night, but now i screwed it up and can’t fix it. Here’s what I am doing: Displaying multiple fields in one flash textbox. I have it working where only one field can be displayed. I don’t know how to combine my multiple fields to display in the textbox “title”.

Oh I am using php and mySQL

Here is the code that display’s one field:


  $result = mysql_query($query);


  $num_results = mysql_num_rows($result);

 

  for ($i=0; $i <$num_results; $i++){
    $row = mysql_fetch_assoc($result);
	print "title=".$row['date']; 

Title being the flash variable, date being a field in my database. Also how wil I be able to display all records in that field. i am used to ASP which just uses a loop. Not sure how to “loop” in php.

Thanks

there are tons of different ways to go about this… just figuring how you want to do it is the tough part. It really depends on how your flash file is set up… actually what i would do is this:


// PHP FILE
$title = "";  // I do this to tell me that $title is going to be a string.
for ($i=0; $i <$num_results; $i++){  // for loop
$row = mysql_fetch_assoc($result);  // You know what this is
$title .= $row['date'] . "\\\r\\
"; // add to the string
}

print "title=".$title;  //print it out so Flash can read it.

ok seems ok but how am i going to add another record, (“content”), boy this is frustrating


$title .= $row['date'] . "\\\r\\
". $row['content'] . "\\\r\\
";

something like that might work.

if you need more help, i’ll be back online after I take a shower. so catch me on AIM in about 10-15 minutes

thanks jubba, i had to go to sleep. that is exactly what i was talking about. thank you ill give it a go when i get home from work. thanks again G :slight_smile:

jubba, everything is working good. however, for some reason
"\r
" keeps showing in my flash file. i have tried numerous ways of getting this out but no dice. any one have ideas?

it shouldn’t so it should just display as line breaks. change it to
maybe that will work…

you got html enabled on the textfield?
=>try"<br>" instead, or “<p>”

thank you eyes but the problem was having \ instead of \