Jump to content

BuildMyWeb

Members
  • Posts

    188
  • Joined

  • Last visited

Community Answers

  1. BuildMyWeb's post in INSERT if value doesnt already exist was marked as the answer   
    In case this thread gets searched out, this is the query that worked for me.  thanks to help from Jacques1
                $stmt_session = $db_connect->prepare(                 "INSERT INTO sessions ( id, author_id, token, name )                 SELECT ?, ?, ?, ?                 FROM sessions                 WHERE NOT EXISTS (SELECT author_id FROM sessions WHERE author_id=?) LIMIT 1"             )
×
×
  • 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.