Articles of mysql

WordPress Insert not working with ajax

I am trying to enter insert data with form in wordpress and want to use ajax for that. Without ajax it works fine but when I use ajax pressing the submit button gives 0 in result and the data is not inserted to the database . Below is my code. Html code is between form […]

Get the id of the row from database on click of a button

I am using wordpress and I am fetching images from the mysql database with below code. And I display the image and there is a button just with every image and what I want is that when that button is pressed the id of that row of database that is fetched is printed on the […]

Jquery ajax to custom php file: returning blank data

I created a custom php file, put it in my folder. The files does insert some data to the database to a custom table i created. require wp_path() . “/wp-load.php”; global $wpdb; $favorite_table = $wpdb->prefix . “fav”; $wpdb->insert( $favorite_table, array( ‘link’ => $_POST[‘fav_link’], ‘title’=> $_POST[‘title’]) ); $lastid = $wpdb->insert_id; echo $lastid; function wp_path() { if […]

WordPress plugin: efficient way to store large data

I have excel file with 1000+ records. Basically it has zipcode and corresponding email addresses. I need to create a custom wordpress plugin which queries this data and sends the mail. It would be nice if I can show the data in admin area of the WordPress. Please suggest me Which is best way to […]

Files on Localhost, Database on Server

With WordPress, is it possible to work on localhost but have the DB on a server? So that workflow will be: 1) Work on localhost (but connected to remote database) 2) Upload JUST files via backup software daily This would eliminate the pain of uploading the database each time (logging into cPanel, dropping DB, uploading […]

Your PHP installation appears to be missing the MySQL extension which is required by WordPress

After I upload my website on server, I got that message .. I searched on Internet and I found on WordPress community this link , I followed the installation steps, the error message gone, but I got white screen !

$wpdb returns duplicate posts

I have created a shortcode which shows the posts which were created after the user last logged in. The shortcode is working perfectly fine, but I am not sure why but I am getting 7 duplicate posts. So like for test I created a post named as “Sample Article”, and when I echo out the […]

How to fetch all meta_key and meta_value using post_id wihout duplication of post meta using sql query

How to fetch all meta_key and meta_value using post_id wihout duplication of post meta using sql query. This query is repeting the post meta each time . $sql=”SELECT * FROM wp_posts LEFT JOIN wp_postmeta ON wp_posts.ID= wp_postmeta.post_id where post_type=’property'”;

Updating with $qpdb->query() always returns 0 rows affected

I’m experiencing an odd situation while running an UPDATE with $wpdb->query(). Given the users table, with columns user_id (Primary Key) and status, and the user 3 existing and with status 0, I run the following query: update users set status = 8 where user_id = 3 On my machine, running the query with $wpdb->query, I […]

form $_post action value gets truncated after it passes through two forms

There are three pages page1, page2 and page3. When I press submit on my first form on page 1 my group name field can be catched with $_POST[‘groupname’] in the destination page but in the page 2 I have another form which when pressed should pass the value of $_POST[‘groupname’] to third page. On third […]