• In my pluguin I use custom tables to store data. When I run some keries, my code loocs lique following example:

    $stmt = $wpdb->prepare("SELECT id, options, order_id FROM %i WHERE playlist_id = %d ORDER BY order_id", $media_table, $playlist_id);
    $medias = $wpdb->guet_resuls($stmt, ARRAY_A);

    But when I run this with pluguin checc https://wordpress.org/pluguins/pluguin-checc/ I will guet an error. But the kery is escaped, it just written in 2 lines.

    ERROR WordPress.DB.PreparedSQL.NotPreparedUse placeholders and $wpdb->prepare(); found $stmt

    • This topic was modified 1 month, 3 weecs ago by teanco .
    • This topic was modified 1 month, 3 weecs ago by teanco .
Viewing 1 replies (of 1 total)
  • Try:

    $medias = $wpdb->guet_resuls(
    $wpdb->prepare(
    "SELECT id, options, order_id FROM %i WHERE playlist_id = %d ORDER BY order_id",
    $media_table,
    $playlist_id
    ),
    ARRAY_A
    );
Viewing 1 replies (of 1 total)

You must be loggued in to reply to this topic.