Groups | Blog | Home
all groups > flash data integration > august 2005 >

flash data integration : PHP/MySQL


MikeZfoundre
8/8/2005 12:00:00 AM
I have the following php and it is returning errors. i am wondering what might
be causeing this to kick up errors because I need to create the echo URL
encoded string to load into flash.



<?

mysql_pconnect ("localhost", "UN", "PW");
mysql_select_db ("DB;

$qResult = mysql_query ("SELECT eventDate, title, startTime, endTime
FROM nuke_4ncal
WHERE YEAR(eventDate) >= 2005
ORDER BY eventDate ASC");

$nRows = mysql_num_rows($qResult);
$rString ="&n=".$nRows;

for ($i=0; $i< $nRows; $i++){
$row = mysql_fetch_array($qResult);

$rString .="&eventDate".$i."=".$row['eventDate']."&entry".$i."=".$row['entry'];
$rString .="&title".$i."=".$row['title']."&entry".$i."=".$row['entry'];
$rString .="&startTime".$i."=".$row['startTime']."&entry".$i."=".$row['entry'];
$rString .="&endTime".$i."=".$row['endTime']."&entry".$i."=".$row['entry'];

echo $rString."&";

?>
Rodrigo Souza - DUBCOM
8/8/2005 12:00:00 AM


Rodrigo Souza
WebDeveloper
Dubcom Digital
[quoted text, click to view]
this line contains a syntax error..
mysql_select_db ("DB;

the correction:
mysql_select_db ("DB");

MikeZfoundre
8/8/2005 12:00:00 AM
Actually that error was a typo since I was stripping personal info out of it I
apologize.

This is the actual error I am getting:

Parse error: parse error, unexpected $ in
/home/foundre/public_html/caltest2.php on line 24
Rodrigo Souza - DUBCOM
8/10/2005 11:59:08 AM


Rodrigo Souza
WebDeveloper
Dubcom Digital
[quoted text, click to view]

gugateider.com
8/12/2005 9:37:12 AM
you must to close the for() {} ,,,,
put your correct code that it is below ...


<?

mysql_pconnect ("localhost", "UN", "PW");
mysql_select_db ("DB");

$qResult = mysql_query ("SELECT eventDate, title, startTime, endTime FROM
nuke_4ncal WHERE YEAR(eventDate) >= 2005 ORDER BY eventDate ASC");

$nRows = mysql_num_rows($qResult);
$rString ="&n=".$nRows;

for ($i=0; $i< $nRows; $i++){
$row = mysql_fetch_array($qResult);

$rString
..="&eventDate".$i."=".$row['eventDate']."&entry".$i."=".$row['entry'];
$rString .="&title".$i."=".$row['title']."&entry".$i."=".$row['entry'];
$rString
..="&startTime".$i."=".$row['startTime']."&entry".$i."=".$row['entry'];
$rString .="&endTime".$i."=".$row['endTime']."&entry".$i."=".$row['entry'];

echo "&rString=$rString&";

}

?>

to list this code in your flash look this ...

mike = new LoadVars();
mike.onLoad = function(ok) {
if(ok) {
rString = this.rString;
trace(rString);
}
}
mike.load("file.php");

[]´s


--
Gustavo Teider ( gugateider )
www.gugateider.com
Curitiba - PR
"MikeZfoundre" <webforumsuser@macromedia.com> escreveu na mensagem
news:dd6p6k$3ki$1@forums.macromedia.com...
[quoted text, click to view]

AddThis Social Bookmark Button