Sheila,

First let me say thank you for the support and help;  I am most
gratefulto you and everybody else who contirbutes to my education.
I am just not in a position to attend any classes (not that I know of
any round here) at present.   The 'Look!    Isn't php/mysql simple'
intros are fine, but only take one to the point of recognising what is
going on.   I haven't found any of the books recommended a few weeks
ago, so am trying to plough ahead.

Only in the past day or so have I firmly realised that my guides are
of the 'one-eyed man' type.   Now I need a fairly simple syntax
reference...

That sent me back to what are already copious notes, but not - alas! -
a syntax reference, which I have seen somewhere, before I knew its
value.

I can say that what you and Bj have written now makes sense to me, a
week ago it would not!   That is why I turned to another
tutorial/script to amend the one I asked about.   (At the moment it is
on the other machine on which I cannot yet burn CDs - don't ask and no
floppy drive - so won't show the script (from phpfreaks.com) which
seems much simpler and more elegant, turning the form entries into
variables, before doing the processes.

I have taken on board the use of dots and will seek to utilise that.
And will shortly test that simplified version you have given me.

I know there may also be problems with the updating of php;  no doubt
some scripts have not kept pace.

Good luck with writing the lessons;  there must be many like me (and
more to come) looking for bridges, in forms that are easy to
understand, between the intros and the complex and 'faulty' scripts .

Joseph

> Bj wrote:
> > Try rewriting:
> >
> > # Verify if username already exists
> > # 1. Build the query
> > $query = "SELECT_COUNT(*) AS ucount " .
>
> Where did the underscore come from? Should be a space.
>
> >   "FROM book_mydb.members " .
> >   "WHERE members.username = " .
> >   " '{$_POST['username']}' ";
> > # [Incidentally I have no idea what the { } curly
> > # brackets are doing here...]
>
> The curly brackets let you put assoc arrays inside double quotes and
not
> confuse the parser. They mark the beginning and end of the variable.
As
> long as we are using dot to concatenate the strings we can leave {}
out:
>
> $query = "SELECT COUNT(*) AS ucount " .
>     "FROM book_mydb.members " .
>     "WHERE members.username = '" . $_POST['username'] . "' ";
>
> Note the single quotes needed for SQL (to the right of = ) have been
> shifted to neigboring stings.
>
> It's not even necessary to use all those double quotes, this will
work
> just fine:
>
> $query = "SELECT COUNT(*) AS ucount
>            FROM book_mydb.members
>            WHERE members.username = '" . $_POST['username'] . "' ";
>
> > More than ever I am
> > convinced you are trying to learn from someone who is an
incompetent
> > programmer, as well as a poor teacher and careless typist.
>
> I agree. There is a lot of badly written code floating around the
net
> that just gets duplicated over and over again.
>
> Sheila
>
> PS: I teach Intro to PHP at EclecticAcademy.com  Teaching someone
else
> to code is not easy. I mainly try to provide examples of what I
consider
> good programming practices and hope the designers that take my class
> become comfortable enough with PHP to make minor changes to scripts.
I
> hope to add a PHP/MySQL class but it's a lot of work writing good
lessons.
>
> --
> Sheila Fenelon
> http://www.shefen.com



____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set 
WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to