Andy Hassall wrote:
[color=blue]
> On Tue, 22 Jul 2003 23:48:47 +0200, Andreas Paasch <Andreas@Paasch.Net>
> wrote:
>[color=green]
>>Andy Hassall wrote:
>>[color=darkred]
>>> On Tue, 22 Jul 2003 14:19:07 +0200, Andreas Paasch <Andreas@Paasch.Net>
>>> wrote:
>>>
>>>>>> $row = @ mysql_fetch_row($result);
>>>>>
>>>>> Unless the included connection.inc file executes the query, $result is
>>>>> an uninitialized variable. You define the query, but you don't execute
>>>>> it.
>>>>
>>>>Thanks a lot, you are right, that did it.
>>>>I have looked it over for days now trying to locate this one error.
>>>>I really didn't see it. I tried to stay away from the code as that often
>>>>clears ones mind, but even that didn't make me see my error.
>>>
>>> You should avoid the use of @, particularly during development, as this
>>> suppresses errors.
>>>
>>> If you had not had that there, the warning that would have been
>>> produced would
>>> likely have lead you to the problem.[/color]
>>
>>I learn new tricks every day, thanks.
>>The basic code is from my PHP book and I modify it for my specific needs,
>>that causes trouble at times.
>>But I learn ...[/color]
>
> There seems to be a lot of code posted from books (in various programming
> groups) that is:
>
> (a) out of date
> (b) poorly written
> (c) both :-(
>
> So I would be very careful with what you read in books, as it appears
> that
> there are a number of authors that churn out poor code just to get their
> books on the shelves as quickly as possible so they can "make money fast".
>
> This isn't in any way to say that they're of no use; but you should read
> the
> books in very close conjunction with the latest version of the PHP manual
> pages itself so that you can spot any inconsistencies or potential
> problems early on.
>
> PHP is a fairly fast evolving language compared with some others, so
> books
> tend to get out of date quite quickly (just see the number of
> 'register_globals' based posts as an example).
>
> --
> Andy Hassall (andy@andyh.co.uk) icq(5747695) (
http://www.andyh.co.uk)
> Space: disk usage analysis tool (
http://www.andyhsoftware.co.uk/space)[/color]
I'm fully aware of these facts. The one I use for this specific solution is
O'Reilly's Webdatabase applications with PHP and MySQL.
In fact, I don't actually read the book and try out the examples, I just got
their code, analyzed it and modify it - I go by "Learning by doing". Not
the perfect way, but my way.
Alongside this, I read at
www.php.net and
www.mysql.com to get info as much
as possible.
Books are for me a way to start of, but only by doing I learn.
Books have sometimes valuable information about doing things in a better
way. Doesn't mean the code is perfected, but it might often be better then
whats in my mind. That's a learning process for me.
I have learned in time, that O'Reillys books are brilliant and thats the
reason for me to prefer them to start with.
There is always a development going on but If you always want up-to-date
stuff, you never buy a book, you never buy a computer, you never buy a car.
At some point you have to take a decision and go from there. That's what I
do here.
I've learned for the past 20 years, I'm still going strong.
I never reject input nor ideas. Why should I ?
/Andreas
--
Registeret Linux user #292411