Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel check if primary key exists

$keyExists = DB::select(
    DB::raw(
        'SHOW KEYS
        FROM your_table_name
        WHERE Key_name='your_key_name''
    )
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #check #primary #key #exists
ADD COMMENT
Topic
Name
1+3 =