Jump to content

[SOLVED] altering tables in database through php code


shan.india

Recommended Posts

i am writing code for a software for manging staff of a clinic.. and i want that as soon as i insert a new staff  a new field to be created in one of the database table.

One, more thing i want to know is that, that in my software i even want to add data to the fields code will be creating...so how should i write the code for creating fields by altering table and how to use these fields in database.

please help me out soon.

Link to comment
Share on other sites

hey i am clueless.

i have created a code for linking field of a database table with the staff but it is hardcoded.

what i want is that whenever a new field is created in db, it links upto staff like staff1 is linking to event_id_staff_1 where 'event_id_staff_1' is the field name.

$staff_db_name = array (

'staff1' => 'event_id_staff_1',

'staff2' => 'event_id_staff_2',

'staff3' => 'event_id_staff_3',

);

waiting for reply

Thanks

Shan

Link to comment
Share on other sites

There many tutorials around (including the link In my sig) that deal with database management with php. Do you want us to write one specifically for you? I'm not trying to be rude, but you need to learn to walk before you can run and we are not really here to hold your hand.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.