Ninjakreborn Posted March 8, 2007 Share Posted March 8, 2007 Is there a reliable way in php to grab an id from something using information. For instance if there is a table with 10 fields. If you want to pull the id's of any of the data in the form that matched 3 different things. Like if the username equaled joyel, the password equaled david, and the username = businessman Say that for example, you can setup a query to retrieve all the id's of queries matching that. I see mysql_id or something which function is it, and is it reliable. Quote Link to comment https://forums.phpfreaks.com/topic/41810-solved-grab-id/ Share on other sites More sharing options...
artacus Posted March 8, 2007 Share Posted March 8, 2007 A function? No you have to use a query. This is a very vague question for a super guru, BTW. Do you want it to select every row that it finds a match or only rows where all 3 match? Or something like this? WHERE username IN ('joyel','david','businessman') OR password IN ('joyel','david','businessman') OR username IN ('joyel','david','businessman') If you are searching thru columns w/ full text indexes, you can just use MATCH() AGAINST() to do the above. Quote Link to comment https://forums.phpfreaks.com/topic/41810-solved-grab-id/#findComment-202773 Share on other sites More sharing options...
Ninjakreborn Posted March 8, 2007 Author Share Posted March 8, 2007 http://us2.php.net/manual/en/function.mysql-insert-id.php That's what I was thinking of. It didn't do what I thought it did. Topic solved. Quote Link to comment https://forums.phpfreaks.com/topic/41810-solved-grab-id/#findComment-202839 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.