/    Sign up×
Community /Pin to ProfileBookmark

multi table entery

?
Hi all …
I am trying to do some things with mysql and php but I hit abrick wall hard here is the thing..
I have three tables students stage and subjects each student must choose enter their details and choose three subjects from the subject table associated with the stage there is six stages and each have five subjects.
There is five tables
Students
Stage
Subject
Stage_subject
Student_stage

Can I enter data to the three stages using the primary key with will not be assigned until the student data is in the table..
Or how can retrieve the id that I just entered to the student table and pass it to another page where can I using to enter other data
Hence stages and subjects are all ready pre set to the database

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJun 21.2010 — It depends on the DB interface you are using. With the original MySQL extension, you can use mysql_insert_id() to get the auto-increment value assigned by the previous mysql_query() insert query.
Copy linkTweet thisAlerts:
@zizooauthorJun 28.2010 — i can call the previous record but how to use auto_increment in the php file
Copy linkTweet thisAlerts:
@zizooauthorJun 28.2010 — and where do i do the calculation inside the insert code or out side
×

Success!

Help @zizoo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...