Fetching wpdb data from a php file seems to break?

Initial thoughts are that it depends where your load_marque.php file is located. I assume within a theme or plugin. If so, what happens when the file is called directly. If there are some errors, these will be shown on the page. Based on the on here https://codex.wordpress.org/Class_Reference/wpdb your query your query may need to be … Read more

How to print array of specific item

Not really a WordPress question, but I’ll bite. That data is JSON. To manipulate it with PHP you need to decode it with json_decode(). Then you can treat it as a PHP object. So to access the values you’d mention, and assuming the JSON is in a variable named $json: $object = json_decode( $json ); … Read more

Create an unique ID number after submit form

in order to do this use AUTO_INCREMENT PRIMARY KEY while you define your table. Your table should be something like this: CREATE TABLE `order` ( `order_id` INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY, `user_group_id` INT(11) UNSIGNED NOT NULL, `status` BIT, `meta` VARCHAR ( 255 ), `value` TEXT, `update_time` TIMESTAMP )DEFAULT CHARSET = utf8; remember that you could … Read more

How to submit the custom form data in database in WordPress without plugin?

Finally, I got my solution, I added below code in function.php and using shortcode I am getting my form on webpage function st_contact_form(){ ob_start(); ?> <div class=”contact_form-wrapper popup-contact-form”> <form action=”” method=”post” name=”contact_form” id=”contact_form” autocomplete=”off”> <div class=”row”> <div class=”col-xl-6 col-lg-6 col-md-6 col-sm-12 col-xs-12 “> <div class=”form-group”> <input type=”text” name=”name” placeholder=”Name” class=”form-control” required> </div> </div> <div class=”col-xl-6 … Read more

$wpdb->insert not working for last select option

The ID can’t be empty. If you have created your table and set your ID as auto increment, you don’t have to insert it, it will be generated automatically. So all you have to do is the following: $result = $wpdb->insert(‘pagos’, array( “nombre” => $nombre, “tipo” => $tipo, “monto” => $monto), array(“%s”, “%s”, “%d”));

Multiple Address In WP-Option Value

After testing for hours, finally get it done. Here the solution: In database wp_options change the value for siteurl and home from your wordpress url to /path/to/wordpress WordPress URL Path To WordPress Then add these code in the bottom of wp-config.php define(‘WP_HOME’, ‘http://’ .$_SERVER[‘HTTP_HOST’].”https://wordpress.stackexchange.com/”); define(‘WP_SITEURL’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . “https://wordpress.stackexchange.com/” ); Now you can use … Read more

Custom query_posts() parameter

If you have your data in separate table adding support for it in query is somewhat messy. Basically you will need to filter posts_where and posts_join to modify raw SQL query so that your custom table is joined and checked against your custom values. As per [faster :)] anu’s suggestion it would make sense to … Read more