|
Posted by Steve on 10/17/06 16:03
"linda" <newsaccount@tiscali.co.uk> wrote in message
news:4534fc85$2_3@mk-nntp-2.news.uk.tiscali.com...
|
| "Steve" <no.one@example.com> wrote in message
| news:FN6Zg.264$_z4.0@newsfe07.lga...
| >
| > "linda" <newsaccount@tiscali.co.uk> wrote in message
| > news:4534f78a_2@mk-nntp-2.news.uk.tiscali.com...
| > |
| > | ----- Original Message -----
| > | From: "Steve" <no.one@example.com>
| > | Newsgroups: alt.php
| > | Sent: Tuesday, October 17, 2006 4:16 PM
| > | Subject: Re: on input form showing error message for duplicate entry.
| > |
| > |
| > | >
| > | > "linda" <newsaccount@tiscali.co.uk> wrote in message
| > | > news:4533f42a$1_2@mk-nntp-2.news.uk.tiscali.com...
| > | > |I very new to php could someone please explain how to write an
error
| > | > message
| > | > | into my AddNew.php below. id is set to unique so at the moment if
| > | > someone
| > | > | adds a product and the id is already in the database, it just
| > doesn't
| > | > enter
| > | > | anything. Ideally I would like to display an error message, with
a
| > back
| > | > | button to correct the id.
| > | > |
| > | > | So far I've tried running a SELECT query with an if statement
prior
| > to
| > | > the
| > | > | INSERT but I just don't know enough php to get this to work. I
| > would
| > be
| > | > | very greatful for any info and advice from those in this
newsgroup.
| > | > |
| > | > | Many, many thanks in advance,
| > | > | Linda
| > | >
| > | >
| > | > linda,
| > | >
| > | > here's a basic maintenence script i have for managing
| > "people"...forget
| > | > about the require_once files and just look at the programmatic flow.
| > | > you'll
| > | > need to change the db calls so that they are appropriate for your
| > setup.
| > | > notice there is some validation in javascript but you also need to
add
| > the
| > | > same validation in php since not all your visitors/customers will
have
| > js
| > | > enabled. sorry for the text-wrapping. and contrary to the dipshit
| > comment
| > | > made by ikciu, this is NOT a stupid question at all.
| > | >
| > | > hth,
| > | >
| > | > me
| > |
| > | Many, many thanks Steve,
| > |
| > | I have just c&p'd your code into my editor to take a look at it! I'm
| > very
| > | greatful to you for sharing this. I'm so new at this (three weeks
new;-)
| > | that every step of changing my partners bussiness site from static to
| > | dynamic has been a true hurdle. Teaching yourself requires so much
more
| > | work lol... but I'm getting there slowly. It's through kind help from
| > | people like yourself that I am able get anywhere at all. Though with
| > that
| > | said, I have that "very proud of myself" feeling atm, that I've got as
| > far
| > | as I have.
| > |
| > | No doubt I'll be back with more newbie questions, "watch this space!".
| > |
| > | Best wishes,
| > | Linda
| >
| >
| > not a problem. if you can fix the script that i posted to match your
| > environment, then altering it to maintain *any* data is pretty easily
done
| > just by changing the values being received, the sql statements,
| > validation,
| > and <input> fields. it is kind of a template, just not in the truest
| > sense.
| > really, the only other tool you will probably need will be for
reporting.
| > i've got samples for that as well including dynamic bar charts and line
| > graphs.
| >
| > best of luck.
| >
| >
| You're a star!
|
| Just glanced at it, will be taking an indepth look at it later. Yours is
| the much better option than my previous post of revised code! It's not
easy
| learning php, so I'm very greatful to examples of how I do certain jobs.
I
| have a few questions, so maybe later (as Motherly duties have kicked in
now,
| food for the starving lol ) if you wouldn't mind indulging me and you have
| the time of course!
|
| Kindest regards,
| Linda
not a problem...and, you should feel accomplished. programming takes a
different kind of mindset...and very few people are gifted at teaching it
though they may be very adept at it. i don't think i'm a good teacher but do
think people are very capable of understanding what code is doing if written
well and commented where needed. i have tons of examples you'd be able to
pick up on...that's probably the best help i could be.
Navigation:
[Reply to this message]
|