PDA

View Full Version : Displaying Multiple Fields In One Flash TextBox



Digitalosophy
June 19th, 2003, 09:15 PM
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

Jubba
June 20th, 2003, 12:50 AM
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\\\n"; // add to the string
}

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

Digitalosophy
June 20th, 2003, 01:00 AM
ok seems ok but how am i going to add another record, ("content"), boy this is frustrating

Jubba
June 20th, 2003, 01:02 AM
$title .= $row['date'] . "\\\r\\\n". $row['content'] . "\\\r\\\n";


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

Digitalosophy
June 20th, 2003, 11:12 AM
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 :)

Digitalosophy
June 20th, 2003, 09:38 PM
jubba, everything is working good. however, for some reason
"\\r\\n" keeps showing in my flash file. i have tried numerous ways of getting this out but no dice. any one have ideas?

Jubba
June 21st, 2003, 01:44 AM
it shouldn't so it should just display as line breaks. change it to \r\n maybe that will work...

eyezberg
June 21st, 2003, 05:10 PM
you got html enabled on the textfield?
=>try"<br>" instead, or "<p>"

Digitalosophy
June 21st, 2003, 05:28 PM
thank you eyes but the problem was having \\ instead of \