mattsolomon Posted March 7, 2011 Share Posted March 7, 2011 i have built an event adding script... when the admin adds an event a drop down menu pulls all the users in the DB to create the event for.. i set the option to their full name, but the value to the userid... when it stores it to the database it stores the userid as XXX for example, but i'd like to store in another field their full name according to the userid, how is this acheivable im completly baffled. Link to comment https://forums.phpfreaks.com/topic/229821-event-adder/ Share on other sites More sharing options...
redarrow Posted March 7, 2011 Share Posted March 7, 2011 user userid username tel note user_info id userid username tel note primary_key just the field id, in this case, and the userid was from the user's primary id, that why we can see everthink, useing the user's id, in both tables. do you get it.... Link to comment https://forums.phpfreaks.com/topic/229821-event-adder/#findComment-1183788 Share on other sites More sharing options...
mattsolomon Posted March 7, 2011 Author Share Posted March 7, 2011 sorry that hasn't made much sense to me maybe it would help if i tell you the current tables and how they work TABLE: Client_details userid company firstname lastname email tel address websites username password clientid userlevel timestamp ip userid is the session id so changes each time TABLE: events eventid clientid occasion location date i am going to add another field (full name) but i was just after the method of adding hope this is clear Link to comment https://forums.phpfreaks.com/topic/229821-event-adder/#findComment-1183792 Share on other sites More sharing options...
redarrow Posted March 7, 2011 Share Posted March 7, 2011 You need the id off the user, in every table, to get that user's info out. that it? long_user_name. id <<<< table id ((auto_increment)) userid <<< users id ((varchar)) username ((varchar)) surname ((varchar)) dob ((varchar)) your EVENTS TABLE clientid is suppose to be userid your getting confused mate..... Link to comment https://forums.phpfreaks.com/topic/229821-event-adder/#findComment-1183793 Share on other sites More sharing options...
MSUK1 Posted March 7, 2011 Share Posted March 7, 2011 I think what he means is, when adding the event he needs it to store both client id and their full name Userid is the session Id when a user logs in and client Id is their unique identifier Link to comment https://forums.phpfreaks.com/topic/229821-event-adder/#findComment-1183907 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.