[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] PHP & MySQL
Craig Andrews wrote:
>On Friday 08 March 2002 10:16 pm, you wrote:
>
>>the pages are brilliant, examples are crystal clear and work out of the
>>box--except I am puzzled by one wee thing:
>>I don't get carriage returns from the (shortened) snippet
>>
>> while ($row = mysql_fetch_row($result)) {
>> printf("%s %s\n", $row[0], $row[1]);
>>}
>>
>
>This won't, as I didn't put on in. D'Oh!
>
Yes, pretty D'Oh I have to agree.
I thought that the \n in the format string meant a carriage return. In
my further ignorance I assumed that it would then be translated to a
<br>. But perhaps it does insert a cr as you suggest below for the echo
"stuff\n", and just produce a cr in the "source". Hmm. I wonder if
there is a formal semantics anywhere for php. Then I might stand a
chance of understanding just how it works :-)
>>nor does echo "stuff\n" produce a cr. Bug or feature? Anyone else have
>>similar behaviour?
>>
>
>It does produce one, but only in the source HTML. You need to echo <br> to
>break the line in the output document in the browser window. It is just HTML,
>after all.
>
>When I finish the outputting tutorial, this will become crystal clear :)
>
I'm looking forward to it.
>>btw I am a complete beginner at AMP...but I might just get hooked...
>>
>
>It is a very easy way to get into web development, thanks to the miriad ways
>PHP can do anything. Some of it's concepts and obejct orientation
>implementation is a bit knackered, but as a prodecural language it is just
>fine :)
>
I think you've just coined a great new term, like procedural but
produces code which is then "cured" by a browser...
anyway, compared with my experience "developing" a web site with
FrontPage it is bliss
>
--
== . Matt Fairtlough . +44 (0)114 236 2067 . ==
== . 22 Harley Road . . ==
== . Sheffield, S11 9SE, UK . matt [at] fairtlough.net . ==
___________________________________________________________________
Sheffield Linux User's Group - http://www.sheflug.co.uk .
To unsubscribe from this list send mail to
shef-lug-request@list.sheflug.org.uk with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.