PHP forums, MySQL forums, Web Development resources

Home PageHome    PHP ResourcesTopic List    FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups 
 RegisterRegister
    ProfileProfile    Log in to check your private messagesLog in to check your private messages    Download the RSS Reader RSS Feed Download the RSS Reader RSS for this forum Log inLog in 

PHP Forum :: MySQL Forum :: Java Script Forum



How do I validate a field with data from existing values

 
Post new topic   Reply to topic    WeberForums.com Forum Index -> MySQL General
View previous topic :: View next topic  
Author Message
wackattack



Joined: 29 Apr 2008
Posts: 1

PostPosted: Tue Apr 29, 2008 5:52 am    Post subject: How do I validate a field with data from existing values Reply with quote

Hi, Im a beginning PHP/MySQL developer and I'm trying to figure out how to do something, any help would be awesome.

Basically if i enter a value into a table using INSERT INTO; how do make PHP know and alert me when that value is already somewhere else in the table.

what i need to do is this...
I have 2 tables, 'people' and 'times'
'people' has columns (id, firstname, lastname) ;
'times' has columns (tid, time_in, time_out) ;

I filled in the 'people' table manually from a handwritten roster.
the 'times' table is filled in as people clock in and out, the person's id is INSERTed into the 'tid' field.

the goal is to clock people in and clock them out, if they're id is not already in the 'people' table with their names, then dont add the id to the 'time.tid' field and echo an alert

i have an html table that displays id, firstname, lastname, time_in, time_out from the 'times' and 'people' tables and they are JOINed together.

i have a small form where you can enter in a person's id, time is auto populated, and it is $_POSTed to the 'times' table ;

when this thing works i'd love upload it as a small open source app, I'll definitely include the people that helped in the source code. Thanks!
_________________
the following statement is true...
the above statement is false.
Back to top
View user's profile Send private message
Display posts from previous:   
WeberTrivia Questions WeberTrivia Questions
 Think you are smart? Prove it!. Try your skills with these questions :
 WeberTrivia QuestionsRecursive arrays and multi-dimensional arrays are one and the same. (PHP and MySQL)
 WeberTrivia QuestionsThe \"cache_dir\" tag of the squid configuration has a default of /var/spool/squid. (Linux)

WeberTrivia Questions



Post new topic   Reply to topic    WeberForums.com Forum Index -> MySQL General All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum






Powered by phpBB © 2001, 2005 phpBB Group
PHP Forum :: MySQL Forum :: Java Script Forum