Jump to content

[SOLVED] grab id


Ninjakreborn

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/41810-solved-grab-id/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/41810-solved-grab-id/#findComment-202773
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.