Bj,
You lightened my mood. Yes I have noticed that this tutorial has
some errors, and I did wonder how complex he'd made it. I found
another tutorial on phpfreaks.com, dealing with a similar project, and
substituted some of that. It worked well till that tutorial left me
floundering -- I am trying to sort a problem to do with VALUES syntax,
and can't find the rules at this moment!!!
I suppose I am finding these surrogate code parents have feet of clay.
I think I have looked at most available tutorials and conclude I still
need simply written stuff which does it all for me until I can start
to recognise what it is doing. I am using HTML-Kit and phpMyAdmin to
write and check, and IE6 as the browser.
I am relieved that you find the complex bit complex; I feel slightly
less of an idiot.
> But hey, who needs tutorials when php and mySQL are so easy. Why
not just
> find a real project and learn while you do it.
You mean it's *not* plug and play?
Seriously I couldn't get my head round the tutorials and had to go at
it another way . And the Manuals, as references, are just
unmanageable - at least in any format I've found them. Perhaps I'll
get some time to sit down for a spell and really concentrate on it
soon.
Thanks for brinigng clarity and light Bj.
Joseph
> Hi Joseph
>
> First a dsiclaimer, in view of my closing remark, I apologise in
advance for
> any inadvertent slips in the following code... :-)
>
> > This: '{$_POST['username']}' "),0); in the SELECT
> > query is the fault with the other problem, but I cannot work
> > out what is wrong with it. So far I haven't discovered a
> > reference or an example which makes the problem clear,
> > let alone the solution.
>
> I'm sure very few experienced programmers would write a complex
statement
> like that, and definitely not in an example for beginners to follow.
Far
> better practice is to break things down into simple steps rather
than string
> them together into an indecipherable lump (er... let's leave regular
> expressions out of this for now...)
>
> Try rewriting:
>
> # Verify if username already exists
> # 1. Build the query
> $query = "SELECT_COUNT(*) AS ucount " .
> "FROM book_mydb.members " .
> "WHERE members.username = " .
> " '{$_POST['username']}' ";
> # [Incidentally I have no idea what the { } curly
> # brackets are doing here...]
> # To help debugging, display the query at this point
> # so you know what you are asking the db
> print "Query is : $query<br>\n";
> # 2. Execute the query:
> $result = mysql_query($query);
> # Check for a mySQL error:
> if mysql_error() > ""
> print "Error: " . mysql_error() . "<br>\n";
> else {
> # 3. Get the result of the query
> $_ucount = mysql_result($result,0);
> }
>
> Note that I wouldn't ever use mysql_result myself, as I prefer (as
good
> programming!) mysql_fetch_row and mysql_fetch_array. 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.
>
> There are some great php and mySQL tutorials on WDVL as well as
DevShed
>
> But hey, who needs tutorials when php and mySQL are so easy. Why
not just
> find a real project and learn while you do it.
>
>
> ____ . 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.unsub%%
>
> 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.
>
____ � 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.