“Wstaw dane do tabeli w WordPress 2” Kod odpowiedzi

Wstaw dane do tabeli w WordPress

if ( isset( $_POST['submit'] ) ){

         global $wpdb;
         $tablename = $wpdb->prefix.'post_job';

        $wpdb->insert( $tablename, array(
            'organizationname' => $_POST['organizationname'], 
            'post' => $_POST['post'],
            'publishfrom' => $_POST['publishfrom'], 
            'publishupto' => $_POST['publishupto'],
            'qualification1' => $_POST['qualification1'], 
            'qualification2' => $_POST['qualification2'], 
            'qualification3' => $_POST['qualification3'],
            'qualification4' => $_POST['qualification4'], 
            'experience1' => $_POST['experience1'], 
            'experience2' => $_POST['experience2'],
            'experience3' => $_POST['experience3'], 
            'training1' => $_POST['training1'], 
            'training2' => $_POST['training2'], 
            'training3' => $_POST['training3'],
            'training4' => $_POST['training4'], 
            'training5' => $_POST['training5'] ),
            array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) 
        );
    }
Yucky Yak

Wstaw dane do tabeli w WordPress 2

<?php

if ( isset( $_POST['submit'] ) ){

    global $wpdb;


    $tablename=$wpdb->prefix.'post_job';

    $data=array(
        'organizationname' => $_POST['organizationname'], 
        'post' => $_POST['post'],
        'publishfrom' => $_POST['publishfrom'], 
        'publishupto' => $_POST['publishupto'],
        'qualification1' => $_POST['qualification1'], 
        'qualification2' => $_POST['qualification2'], 
        'qualification3' => $_POST['qualification3'],
        'qualification4' => $_POST['qualification4'], 
        'experience1' => $_POST['experience1'], 
        'experience2' => $_POST['experience2'],
        'experience3' => $_POST['experience3'], 
        'training1' => $_POST['training1'], 
        'training2' => $_POST['training2'], 
        'training3' => $_POST['training3'],
        'training4' => $_POST['training4'], 
        'training5' => $_POST['training5'] );


     $wpdb->insert( $tablename, $data);
}

?>
Yucky Yak

Odpowiedzi podobne do “Wstaw dane do tabeli w WordPress 2”

Pytania podobne do “Wstaw dane do tabeli w WordPress 2”

Więcej pokrewnych odpowiedzi na “Wstaw dane do tabeli w WordPress 2” w PHP

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu