[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread Cheryl D. Wise
I teach the web accessibility class there and will also pass your interest
along. 


Cheryl D. Wise
Certified Professional Web Developer
MS-MVP-FrontPage
www.wiserways.com
mailto: [EMAIL PROTECTED]
713.353.0139 Office

-Original Message-
From: Sheila Fenelon

rudy wrote:
>>I teach an "Intro to PHP" class at EclecticAcademy.com - low cost but 
>>not free. They keep asking for a PHP/MySQL class.
> 
> 
> cool
> 
> let me know if you need an SQL instructor
> 

I'll pass your name and email on to the people that run it. A separate SQL
class would be great.


 • 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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread Sheila Fenelon
rudy wrote:
I teach an "Intro to PHP" class at EclecticAcademy.com - low cost but 
not free. They keep asking for a PHP/MySQL class.


cool

let me know if you need an SQL instructor

I'll pass your name and email on to the people that run it. A separate 
SQL class would be great.

Sheila

 • 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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread rudy
> I teach an "Intro to PHP" class at EclecticAcademy.com - low cost but 
> not free. They keep asking for a PHP/MySQL class.

cool

let me know if you need an SQL instructor



rudy

 • 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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread Sheila Fenelon
rudy wrote:
you're writing lessons to teach php/mysql?  where?  will they be on the web?

I teach an "Intro to PHP" class at EclecticAcademy.com - low cost but 
not free. They keep asking for a PHP/MySQL class.

Sheila
--
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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread Sheila Fenelon
Trusz, Andrew wrote:
What's missing in most courses is the foundation. It's usually a quick jump
from "hello world" to forms, email, and a shopping cart without the
discussion of the ' " { ) ] ; not to mention regular expressions. A good
foundation might have saved poor Joe a headache or two. Although the agony
of working through the tutorials may have elevated his expressive language
abilities. 

I'll let you know how you did in about 5 weeks, Shelia.

I thought your name looked familiar, but wasn't sure where I'd seen it, 
I'm on too many lists. That reminds me, I'll be gone next week, and 
without internet or computer. I'll make the next lesson available early, 
like tomorrow.

Sheila





 • 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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread Trusz, Andrew


-Original Message-
From: Sheila Fenelon] 
Sent: Tuesday, March 09, 2004 2:26 PM
To: [EMAIL PROTECTED]
Subject: [wdvltalk] Re: $_POST and access questions

rudy wrote:
>>I think you really could learn SQL in ten one-minute lessons from it. 
> 
> 
> yes, like you can learn how to play chess in 10 minutes, too
> 

Which is exactly why I'm having so much trouble writing lessons to teach 
PHP/MySQL. There is a lot to cover. I didn't learn what I know in six 
one-hour lessons. The best I could hope to do is provide a good foundation.


Sheila
--
Sheila Fenelon
http://www.shefen.com/

What's missing in most courses is the foundation. It's usually a quick jump
from "hello world" to forms, email, and a shopping cart without the
discussion of the ' " { ) ] ; not to mention regular expressions. A good
foundation might have saved poor Joe a headache or two. Although the agony
of working through the tutorials may have elevated his expressive language
abilities. 

I'll let you know how you did in about 5 weeks, Shelia.

drew

  

 • 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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread rudy
> Which is exactly why I'm having so much trouble writing lessons to teach
> PHP/MySQL. There is a lot to cover. I didn't learn what I know in six
> one-hour lessons. The best I could hope to do is provide a good
foundation.

you're writing lessons to teach php/mysql?  where?  will they be on the web?


rudy


 • 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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread Sheila Fenelon
rudy wrote:
I think you really could learn SQL in ten one-minute lessons from it. 


yes, like you can learn how to play chess in 10 minutes, too

Which is exactly why I'm having so much trouble writing lessons to teach 
PHP/MySQL. There is a lot to cover. I didn't learn what I know in six 
one-hour lessons. The best I could hope to do is provide a good foundation.

Sheila
--
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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread rudy
> I think you really could learn SQL in ten one-minute lessons from it. 

yes, like you can learn how to play chess in 10 minutes, too


;o)


 • 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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread JimMenees
In a message dated 3/9/2004 1:55:33 PM Eastern Standard Time, [EMAIL PROTECTED] writes:
>> I used to use an SQL tutorial on the Web  >>

I haven't been following this thread, but caught the above comment.  There's a nice 
sql tutorial with an online testing forum at: http://sqlcourse.com/   
or the advanced version at: http://sqlcourse2.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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread Bj
> I am trying to sort a problem to do with VALUES syntax,
> and can't find the rules at this moment!!!

I used to use an SQL tutorial on the Web, but found it was much easier to
keep a copy of Sams "Teach Yourself SQL in 10 minutes" on the shelf, it was
about £8 in PCWorld I think.  Not only is it still a really useful lookup, I
think you really could learn SQL in ten one-minute lessons from it.  It's
currently £7.69 from Amazon
(http://www.amazon.co.uk/exec/obidos/ASIN/0672321289/therealhhg) and they
also do "in 24 hours" and "in 21 days" versions that presumably go into it
much more deeply.

Anyway - we're here - don't struggle just ask :-)



 • 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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread Joseph, Smile Poet
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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread Joseph, Smile Poet
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\n";
> # 2. Execute the query:
> $result = mysql_query($query);
> # Check for a mySQL error:
> if mysql_error() > ""
>   print "Error: " . mysql_error() . "\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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread Sheila Fenelon
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.



[wdvltalk] Re: $_POST and access questions

2004-03-09 Thread Bj
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\n";
# 2. Execute the query:
$result = mysql_query($query);
# Check for a mySQL error:
if mysql_error() > ""
  print "Error: " . mysql_error() . "\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 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.



[wdvltalk] Re: $_POST and access questions

2004-03-08 Thread Joseph, Smile Poet
Sheila and Robin,

Thanks very much.   You were right about the variable *not* having
been defined;   I'm a bit closer to understanding and being able to
watch out for that!

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.

Joseph

>


> Hi Joseph,
>
> Joseph, Smile-Poet wrote:
> > Why this:
> > Notice: Undefined variable: email_error in
c:\easyphp1-7\www\join.php on line 65
> >
> > if the following two queries define the variable?:
> >
> > if(!$_POST['email_address']){
> > $errors .= "Missing Email address\n";
> > $email_error = true ;
> > }
> > if(!$_POST['email_address2']){
> > $errors .= "Missing Email address".
> >   "Verification\n";
> > $email_error = true ;
> > }
> >
> >
> > file://If both emails were posted, validate they match.
> > (line65) if( $email_error ==
se){ 
> >  if($_POST['email_address'] !=
> > $_POST['email_address2']){
> >  $error = true;
> >$errors .= "Email addresses do not match!\n\n";
> > $email_error = true;
> > }
> > 
> 
> $email_error needs an initial value. Add this line
>   $email_error = false;
> before the first 'if' statement.
> 
> 
> > Warning: mysql_result(): supplied argument is not a valid MySQL result resource in 
> > c:\easyphp1-7\www\join.php on line 102
> > 
> This usually means there is something wrong with the SQL statement.
> 
> > from this:
> > 
> >  file://Verify if username already exists
> > $_ucount = mysql_result(mysql_query("SELECT_COUNT(*)
> > AS ucount FROM book_mydb.members
> > WHERE members.username =
> >  (line 102)'{$_POST['username']}' "),0);
> > 
> 
> Break this up into several steps so you can find the problem,
> 
> $sql = "SELECT_COUNT(*) AS ucount FR
OM book_mydb.members
> '{$_POST['username']}' ";
>
> $result = mysql_query($sql);
>
> if ($result) {
>$_ucount = mysql_result($result);
> } else {
>echo mysql_errno() . ": " . mysql_error(). "\n";
>echo "SQL: $sql\n";
> }
>
>
>
> Sheila
> --
> 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.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.



[wdvltalk] Re: $_POST and access questions

2004-03-08 Thread Robin Hastings
Quoting "Joseph, Smile-Poet" <[EMAIL PROTECTED]>:

> Why this:
> Notice: Undefined variable: email_error in c:\easyphp1-7\www\join.php on line
> 65
> 
> if the following two queries define the variable?:
> 
>   if(!$_POST['email_address']){
>$errors .= "Missing Email address\n";
>   $email_error = true ;
>   }
>   if(!$_POST['email_address2']){
>$errors .= "Missing Email address".
> "Verification\n";
>   $email_error = true ; 
>   }
> 
This error is coming up because, if you don't have a missing email address,
$email_error isn't being defined at all. What you might want to do is add a line
above the two if blocks that defines $email_error = false, then if the email is
missing, it will be redefined as true then. Make sense?
> 
>   //If both emails were posted, validate they match.
> (line65)  if( $email_error == false){ 
>  if($_POST['email_address'] !=
> $_POST['email_address2']){
>  $error = true;
>   $errors .= "Email addresses do not match!\n\n";
>   $email_error = true;
>   }
> 
> AND
> 
> why this:
> Warning: mysql_result(): supplied argument is not a valid MySQL result
> resource in c:\easyphp1-7\www\join.php on line 102
> 
> from this:
> 
>  //Verify if username already exists
>   $_ucount = mysql_result(mysql_query("SELECT_COUNT(*)
> AS ucount FROM book_mydb.members
>WHERE members.username =
>  (line 102)'{$_POST['username']}' "),0);
> 
> Joseph   (I'm not *that* far advanced, these are from a tutorial;  but after
> aplying what little knowledge I've gained I'm getting the same errors.   And
> the servers *are* turned on!)
For this one I'm not sure - what I usually do is create my SELECT statement as a
variable (eg. $select = "SELECT_COUNT(*)...";) and include that variable in the
mysql_query function. This makes it easy to echo out the $select variable to see
what is being passed to the function and to find out why the query isn't working. 
-- 
Robin Hastings
[EMAIL PROTECTED]




 • 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.



[wdvltalk] Re: $_POST and access questions

2004-03-08 Thread Sheila Fenelon
Hi Joseph,

Joseph, Smile-Poet wrote:
Why this:
Notice: Undefined variable: email_error in c:\easyphp1-7\www\join.php on line 65
if the following two queries define the variable?:

	if(!$_POST['email_address']){
		 $errors .= "Missing Email address\n";
		$email_error = true ;
	}
	if(!$_POST['email_address2']){
		 $errors .= "Missing Email address".
	  "Verification\n";
		$email_error = true ; 
	}

//If both emails were posted, validate they match.
(line65)if( $email_error == false){ 
 if($_POST['email_address'] !=
$_POST['email_address2']){
 $error = true;
$errors .= "Email addresses do not match!\n\n";
$email_error = true;
}
$email_error needs an initial value. Add this line
 $email_error = false;
before the first 'if' statement.

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in c:\easyphp1-7\www\join.php on line 102

This usually means there is something wrong with the SQL statement.

from this:

 //Verify if username already exists
$_ucount = mysql_result(mysql_query("SELECT_COUNT(*)
AS ucount FROM book_mydb.members
 WHERE members.username =
 (line 102)  '{$_POST['username']}' "),0);
Break this up into several steps so you can find the problem,

$sql = "SELECT_COUNT(*) AS ucount FROM book_mydb.members 
'{$_POST['username']}' ";

$result = mysql_query($sql);

if ($result) {
  $_ucount = mysql_result($result);
} else {
  echo mysql_errno() . ": " . mysql_error(). "\n";
  echo "SQL: $sql\n";
}


Sheila
--
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.