Anyone with PHP experience want to tell me what's wrong,,,

…with this script\r\rinclude_once (“filelock/db_include.php”);\r//make connection\r$connect = mysql_connect($db_host,$db_user,$db_password);\r//select database\rmysql_select_db($db_name,$connect);\r//query table\r$result=mysql_query(“SELECT * FROM $table_name,$connect);\r$counter=0;\rwhile ($myrow = mysql_fetch_array($result)){\rprintf(”&date$counter=%s&name$counter=%s&email$counter=%s&site$counter=%s&comment$counter=%s",rawurlencode($myrow[“date”]),rawurlencode($myrow[“name”]),rawurlencode($myrow[“email”]),rawurlencode($myrow[“site”]),rawurlencode($myrow[“comment”]));\r$counter++;\r}\r$flag="&flag=true";\recho “$flag”;\r\rI’m getting a parse error on line 11… which in the case of the script above is line 10 because I left off the php opener and closer tags. So it’s the “printf” line

Im just gettin’ started with php, never used mySql before, so…\r\r1. what’s the f in printf for?\r2; “while ($myrow = mysql_fetch_array($result)){” looks weird to my unknowing eyeZ; you use a single = and where does the loop get incremented?\r\rJust guessing…\r\rPS: you should ask 'bout this at www.phpforflash.com , good forum…)

there’s a counter++ at the bottem\r\rthe printf command comes from Flash Developer’s Guide.\r\rReally all I want to do is query the table and then send all that data to flash… every row, every column… If you have another script that would work better, I’d be happy to use it instead.

“there’s a counter++ at the bottem” …\ryes, but where is it used in the while so the condition check ever gets false?

Well… I got it working… so I know it works… :slight_smile: \r\rwhile ($myrow = mysql_fetch_array($result)){\r printf("&date$counter=%s&name$counter=%s&email$counter=%s&site$counter=%s&comment$counter=%s",rawurlencode($myrow[“date”]),rawurlencode($myrow[“name”]),rawurlencode($myrow[“email”]),rawurlencode($myrow[“site”]),rawurlencode($myrow[“comment”]));\r$counter++;\r}\r\rthe counter incriments every time the script runs through. the counter itself though, is not what stops the loop, its the mysql_fetch_array command that does that. The counter is just there to add a unique number to the end of each of the array items.