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