php - How do I check if data in a column already exists and to check the second column of that row to equal a specific number -


everyone!

i having trouble creating mysql statement.

example:

i have 1 column named 'keys', , column named 'isused', , 'keys' column consists of many different keys in format: xxxx-xxxx-xxxx, , want check if key has been used or not.

this format of table:

     key          |   isused xxxx-xxxx-xxxx    |      0 

i have made checks if key exists using code:

$arrexistkey = mysqli_query($resdbcon, "select key keys key = '$strkey'"); $intkeys = mysqli_num_rows($arrexistkey);  if ($intkeys != 1) {     senderror('the beta-key not exist!'); } 

so have checked if key exists, i'm trying figure out how check if has been used.

if can me out, great! thank you.

how encoding logic in sql?

$arrexistkey = mysqli_query($resdbcon, "select key keys key = '$strkey' , isused = 1"); 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -