desert_gold_hound Posted March 26, 2009 Share Posted March 26, 2009 NEW HERE and to web languages. I am doing pretty well studding from w3school.com. I am trying to build an application for our grooming shop that we can keep track of customers. This is not an appointment book just a customer reference. I am using 5.0 I have the following DB's Customer Phone = With FK to Customer = Some have 5 or 6 numbers this is why its in its own db Pet = With FK to Customer GroomingInfo = With FK to Customer What I am doing is building the forum to input a new Customer, 1 phone number, and 1 pet. I figure they can add more and the grooming info once that is created. My problem is how do I get the CustomerID (it puts its own value in so there is no chance of user error) so that the form can add the FK to the Phone and Pet? I would like to get this in the forum of a Variable such as $custID and then use that. I tried to use the mySQL command LAST but couldn't figure out how to make this work. I tried using it similar to this. $custID = mysql_query(SELECT LAST * FROM CustomerID); and that didn't give me anything not even an error. Link to comment https://forums.phpfreaks.com/topic/151267-solved-new-to-php-and-mysql-please-help/ Share on other sites More sharing options...
Maq Posted March 26, 2009 Share Posted March 26, 2009 I don't really understand your question... If you're trying to get the last inserted ID from customer you have to use mysql_insert_id() right after you insert to the customer table. Link to comment https://forums.phpfreaks.com/topic/151267-solved-new-to-php-and-mysql-please-help/#findComment-794606 Share on other sites More sharing options...
desert_gold_hound Posted March 26, 2009 Author Share Posted March 26, 2009 You don't understand it........I asked it and I am confused LOL ??? I am learning it prety fast, however; there is sooooo many different things to try and tie together. Thanks I think you answered my question though. TY TY TY Link to comment https://forums.phpfreaks.com/topic/151267-solved-new-to-php-and-mysql-please-help/#findComment-794608 Share on other sites More sharing options...
desert_gold_hound Posted March 26, 2009 Author Share Posted March 26, 2009 You don't understand it........I asked it and I am confused LOL ??? I am learning it prety fast, however; there is sooooo many different things to try and tie together. Thanks I think you answered my question though. TY TY TY I thought it might let me edit this but cant. Just wonted to let you know it worked PERFECTLY. It was just what I wonted. Link to comment https://forums.phpfreaks.com/topic/151267-solved-new-to-php-and-mysql-please-help/#findComment-794627 Share on other sites More sharing options...
Maq Posted March 26, 2009 Share Posted March 26, 2009 FYI: You put this in the PHP Regex section which is entirely the wrong place. Glad to see you got it working, please mark as [sOLVED]. Link to comment https://forums.phpfreaks.com/topic/151267-solved-new-to-php-and-mysql-please-help/#findComment-794637 Share on other sites More sharing options...
desert_gold_hound Posted March 26, 2009 Author Share Posted March 26, 2009 FYI: You put this in the PHP Regex section which is entirely the wrong place. Glad to see you got it working, please mark as [sOLVED]. Where should I have placed it? I was debating between this and mysql as this is a mix of both. How do I mark it solved? is this something specific to this forum? Link to comment https://forums.phpfreaks.com/topic/151267-solved-new-to-php-and-mysql-please-help/#findComment-794707 Share on other sites More sharing options...
Maq Posted March 26, 2009 Share Posted March 26, 2009 Where should I have placed it? I was debating between this and mysql as this is a mix of both. Probably PHP Help since it was a PHP function, or MySQL would have done fine. How do I mark it solved? is this something specific to this forum? There is a tab at the bottom right that looks like, "[sOLVED]". I think it's a mod for SMF forums, although it may be standard. Link to comment https://forums.phpfreaks.com/topic/151267-solved-new-to-php-and-mysql-please-help/#findComment-794713 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.