Re: [PHP] Parse error in mysql_query()

2003-12-22 Thread John W. Holmes
Tyler Longren wrote: Hi Matt, I put this right above like 871: print "$_POST[domainregister_domain$i]"; So now that "print" line is 871. It produces the exact same error as the mysql_query() line. The reason I'm doin it like this is cuz I'm dynamically generating forms, and lots of the fields ar

RE: [PHP] Parse error in mysql_query()

2003-12-22 Thread Matt Matijevich
[snip] I put this right above like 871: print "$_POST[domainregister_domain$i]"; So now that "print" line is 871. It produces the exact same error as the mysql_query() line. [/snip] I should have mentioned this in my last email. You should try a print_r of the $_POST array. print ""; print_r($

Re: [PHP] Parse error in mysql_query()

2003-12-22 Thread Tyler Longren
Doing this fixed it: mysql_query("INSERT INTO domainregistrations (domain,type,years,price) VALUES ('$_POST[domainregister_domain]$i','$_POST[domainregister_type]$i','$_POST[domainregister_years]$i','$_POST[domainregister_price]$i')"); I just moved the $i to the outside of the [] and it works now.

RE: [PHP] Parse error in mysql_query()

2003-12-22 Thread Tyler Longren
Hi Matt, I put this right above like 871: print "$_POST[domainregister_domain$i]"; So now that "print" line is 871. It produces the exact same error as the mysql_query() line. The reason I'm doin it like this is cuz I'm dynamically generating forms, and lots of the fields are the same, just wit

Re: [PHP] Parse error in mysql_query()

2003-12-22 Thread John W. Holmes
Tyler Longren wrote: Error: Parse error: parse error, expecting `']'' in /usr/local/apache/htdocs/UP/index.php on line 871 ('$_POST[domainregister_domain$i]', If you're going to be creating array keys like that, break out of the string to do it. ('" . $_POST['domainregister_domain' . $i] . "', ..

RE: [PHP] Parse error in mysql_query()

2003-12-22 Thread Matt Matijevich
[snip] Sorry, should have mentioned that I tried quoting them already. That gives a T_VARIABLES parse error. Thanks for the reply, Tyler [/snip] What happens if you comment out the mysql statement and just echo the variables? echo $_POST[domainregister_domain$i] $_POST[domainregister_ty

RE: [PHP] Parse error in mysql_query()

2003-12-22 Thread Tyler Longren
Sorry, should have mentioned that I tried quoting them already. That gives a T_VARIABLES parse error. Thanks for the reply, Tyler On Mon, 2003-12-22 at 12:30, Sam Masiello wrote: > Perhaps it doesn't like the fact that you don't have quotes around your > array keys? > > --Sam > > > Tyler Long

RE: [PHP] Parse error in mysql_query()

2003-12-22 Thread Sam Masiello
Perhaps it doesn't like the fact that you don't have quotes around your array keys? --Sam Tyler Longren wrote: > Error: > Parse error: parse error, expecting `']'' in > /usr/local/apache/htdocs/UP/index.php on line 871 > > Line 871: > mysql_query("INSERT INTO domainregistrations > (domain,typ