You are here: Re: [PHP] Re: Script stuck on final ?> « PHP « IT news, forums, messages
Re: [PHP] Re: Script stuck on final ?>

Posted by Jochem Maas on 10/02/59 11:07

Alp wrote:
> Thanks to both of you. Unfortunately I have found out it was due to another
> reason: in one function I am trying to insert 3 sets of data into 3 seperate
> tables. In trying to accomplish that I am using a 'for' loop. The minute I
> write in the second 'for' loop I loose the page in browser and receive this

what does "write in the 'for' loop" mean?
what does "loose the page in the browser" mean?

> parse error pointing to the last line of code.
>
> Any ideas to how I can overcome this? The loop I am using is given below.

fix the syntax error, I guess.

>
> Thanks in advance.
>
> Alp
> Code:
> for ($c=0;$c<count($_POST['inctourid']);$c++) {
> if ($_POST['inctourid'][$c]!="" && $_POST['included'][$c]!=""){
> $sql = "INSERT INTO tour_includes (tour_id, included) VALUES
> ('{$_POST['inctourid'][$c]}', '{$_POST['included'][$c]}')\n";
> }
> if (! mysql_query($sql, $link))
> {
> $dberror = mysql_error();
> return false;
> }

where is the ***** closing brace for the for loop?

> // for ($i=0;$i<count($_POST['extourid']);$i++) {
> // if ($_POST['extourid'][$c]!="" && $_POST['excluded'][$c]!=""){
> // $sql = "INSERT INTO tour_excludes (tour_id, excluded) VALUES
> ('{$_POST['extourid'][$c]}', '{$_POST['excluded'][$c]}')\n";
> // }
> // if (! mysql_query($sql, $link))
> // {
> // $dberror = mysql_error();
> // return false;
> // }
>
>
>
>
> "Alp" <alp.bekisoglu@a-group-int.tv> wrote in message
> news:20050203113944.25358.qmail@lists.php.net...
>
>>Why would a php script get stuck at the ver last line of code in php/mysql
>>combination? I'm getting a parse error at the very last line.
>>
>>Thanks in advance for your help.
>>
>>Alp
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация