Skip to content

Tag: php

Insert DATA into 2 tables using one Query using PHP and Mysql

I have 2 tables that I am trying to insert data into using PHP wine_id is auto incremented, then This is my other table For the STOCK table I have stock ID as Auto incremented and wine_id is foreign-key so All i need to insert is quantity. I have a syntax like this: If there is another way to do

get the current page id inside wordpress plugin page

I need to get the current page id in WordPress plugin page outside the loop. And the code I wrote for getting current page id is in my plugin page. I tried many codes, but doesn’t work But it doesn’t work for me . This is also not working. When I try Then a error message appears Fatal error: Call

Mongodb aggregate group by day (php)

I have a collection with documents that look like this: I want to group and count these documents based on the accountCreated date (count per day), but I am stuck with the handling of dates since the date includes time as well. This is what I have, but it returns the count including the time, witch means lots…

replace multiple spaces in a string with a single space

I have a file with has several spaces among the words at some point. I need to clean the file and replace existing multi-spaced sequences with one space only. I have written the following statement which does not work at all, and it seems I’m making a big mistake. My file is very simple. Here is a part …

SELECT All Posts In A Certain Category

I indeed read this post (Get all posts from a specific category) but it does not seem to apply to my situation. My situation is that i have two tables as follows: 1/ table categories category_id …

html2canvas capturing div image

im working on my wordpress site in which i want a div to be converted to image.. im using html2canvas javascript and it works perfect. when i capture a post it saves it to the server has “Captured.jpg”. all good till here.. but when i click capture again on a different post it replaces the previou…