FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » comma placement problem
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: comma placement problem [message #181542 is a reply to message #181530] Tue, 21 May 2013 08:51 Go to previous message
Paul Herber is currently offline  Paul Herber
Messages: 26
Registered: February 2011
Karma:
Junior Member
On Mon, 20 May 2013 14:32:02 -0400, richard <noreply(at)example(dot)com> wrote:

> This does exactly what I want except that when 1969 is reached, the commas
> don't get placed where I want them.
> I need the commas on every line except for the last line.
> which is why I put the conditional just before the \n.
>
>
>
>
>
> $year=1960;
> $number=1;
> $number=(int)$number;
> $year=(int)$year;
>
>
> while ($year<=1969):
>
>
> while ($number<=10):
> $result = mysql_query("SELECT atitle,artist,avid FROM A$year WHERE id =
> $number");
> if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; }
> $vid = mysql_fetch_row($result);
>
>
> echo "{";
>
> echo 'image:';
> echo '""';
> echo ",";
>
> echo "title:";
> echo '"';
> echo $vid[0];
> echo '",';
>
> echo 'file:"http://www.youtube.com/watch?v=';
> echo $vid[2];
> echo '",';
>
> echo 'description:';
> echo '"';
> echo $year." # ".$number." - ".$vid[1];
> echo '"';
>
> echo "}";
> if ($year<1969 and $number<=10){echo ",";}

if (($year<1969) and ($number<=10)){echo ",";}



--
Regards, Paul Herber, Sandrila Ltd.
http://www.sandrila.co.uk/ twitter: @sandrilaLtd
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Immediate Position:::Business Analyst With BI EXP::::At Houston, TX
Next Topic: Problem with quotes in javascript output
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 05:37:51 GMT 2024

Total time taken to generate the page: 0.03384 seconds