Multipe array in meta_input

In your 2nd code snippet, you’re redefining $post_args for each $movie. Try this instead: $post_args = array(); foreach($movies as $movie) { $i++; $post_args[] = array( array( ‘key’ => ‘title’ . $i, ‘value’ => $movie[‘title’] ), array( ‘key’ => ‘qty’ . $i, ‘value’ => $movie[‘qty’] ), array( ‘key’ => ‘desc’ . $i, ‘value’ => $movie[‘desc’] ) … Read more

Insert data into custom table from fetching $_POST values

if(!empty($_POST)) { $player_name = $_POST[‘first_name’]; $payer_email = $_POST[‘payer_email’]; $payment_gross = $_POST[‘payment_gross’]; $payment_date = $_POST[‘payment_date’]; $payer_id = $_POST[‘payer_id’]; $paypal_str = array($player_name, $payer_email, $payment_gross, $payment_date, $payer_id); print_r($paypal_str); global $wpdb; $wpdb->insert( ‘paypal’, array( ‘name’ => $paypal_str[0], ’email’ => $paypal_str[1], ‘amount’ => $paypal_str[2], ‘player_id’ => $paypal_str[3], ‘date’ => $paypal_str[4] ) ); } Remove the unwanted comma from the array.

Combine two foreach Arrays into one table row

if the artist names and track names are in matching order and the same in number then: <?php $artists = get_post_custom_values(‘Artist’, $post->ID); $tracks = get_post_custom_values(‘Track’, $post->ID); $i=0; foreach ( $artists as $key => $value ) { $class = ( $i % 2 ) ? ‘alternative’ : ”; // modulus operator echo ‘<li class=”‘ . $class … Read more

SQL query add only posts with custom field to array

Why don’t you just do: <?php global $post; $args = array( ‘post_type’ => ‘post’, ‘post_status’ = ‘publish’, ‘posts_per_page’ => ’10’, ‘meta_query’ => array( array( ‘key’ => ‘fruit’, ‘value’ => ‘apple’ ) ) ); $custom_query = new WP_Query( $args ); while( $custom_query->have_posts() ): $custom_query->the_post(); ?> <?php the_title(); ?> <?php endwhile; wp_reset_query(); ?>

Fatal error in my WP

Go to your plugins dir wp-content/plugins/ and rename mojo-marketplace-wp-plugin folder. This will deactivate mojo-marketplace and won’t throw you an error when you try to login. Then you can contact with their support and solve this issue.