No its not. the pc needs to be turned on for the task scheduler to work. the best option you have is yo use a cronjob on your webserver that will check your script on a given interval of time.

Hi

First you must create a script that will check your DB if if the duedate is 2 days before. a simple select query will work.something like

SELECT * FROM table WHERE DATEDIFF(NOW(), duedate) < 2

if the statement return true add your send mail code.

for it to send the email automatically(without any user interactions/page load) you need something like task scheduler or much better a cronjob which will run your script on a specific interval of time.

yes sure but its a large file so i'll just trim it down.

this is for the table trans_logs for the Date 2015-06-04

CREATE TABLE IF NOT EXISTS `trans_logs` (
  `translogid` int(6) NOT NULL AUTO_INCREMENT,
  `username` varchar(30) NOT NULL,
  `datetime` varchar(100) NOT NULL,
  `ref` varchar(15) NOT NULL,
  `status` varchar(15) NOT NULL,
  PRIMARY KEY (`translogid`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=26598 ;

INSERT INTO `trans_logs` (`translogid`, `username`, `datetime`, `ref`, `status`) VALUES
(26309, 'Ronel Rapadas', '2015-06-04 12:54', '150603029342', 'Ongoing'),
(26310, 'Ronel Rapadas', '2015-06-04 12:55', '150603029342', 'Served'),
(26311, 'KATRINA LEYESA', '2015-06-04 01:58', '150603027A5C', 'Ongoing'),
(26312, 'KATRINA LEYESA', '2015-06-04 02:02', '150603027A5C', 'Served'),
(26313, 'KATRINA LEYESA', '2015-06-04 02:04', '150603028476', 'Ongoing'),
(26314, 'KATRINA LEYESA', '2015-06-04 02:05', '150603028476', 'Served'),
(26315, 'KATRINA LEYESA', '2015-06-04 02:06', '15060302A2D8', 'Ongoing'),
(26316, 'KATRINA LEYESA', '2015-06-04 02:07', '15060302A2D8', 'Served'),
(26317, 'KATRINA LEYESA', '2015-06-04 02:08', '15060302C708', 'Ongoing'),
(26318, 'KATRINA LEYESA', '2015-06-04 02:09', '15060302C708', 'Served'),
(26319, 'KATRINA LEYESA', '2015-06-04 02:11', '15060302AA39', 'Ongoing'),
(26320, 'KATRINA LEYESA', '2015-06-04 02:11', '15060302AA39', 'Served'),
(26321, 'KATRINA LEYESA', '2015-06-04 02:14', '150603023479', 'Ongoing'),
(26322, 'KATRINA LEYESA', '2015-06-04 02:14', '150603023479', 'Served'),
(26323, 'KATRINA LEYESA', '2015-06-04 02:19', '15060302250E', 'Ongoing'),
(26324, 'KATRINA LEYESA', '2015-06-04 02:19', '15060302250E', 'Served'),
(26325, 'KATRINA LEYESA', '2015-06-04 02:29', '15060402CC37', 'Ongoing'),
(26326, 'KATRINA LEYESA', '2015-06-04 02:30', '15060402CC37', 'Served'),
(26327, 'KATRINA LEYESA', '2015-06-04 02:40', '1506040264F6', 'Ongoing'),
(26328, 'KATRINA LEYESA', '2015-06-04 02:42', '1506040264F6', 'Served'),
(26329, 'Ronel Rapadas', '2015-06-04 03:04', '1506040239FE', 'Ongoing'),
(26330, 'Ronel Rapadas', '2015-06-04 03:05', '1506040239FE', 'Served'),
(26331, 'Ronel Rapadas', '2015-06-04 03:06', '150604022566', 'Ongoing'),
(26332, 'Ronel Rapadas', '2015-06-04 03:06', '150604022566', 'Served'),
(26333, 'Mylinor Breis', '2015-06-04 05:36', '150603025529', 'Ongoing'),
(26334, 'Mylinor Breis', '2015-06-04 05:36', '150603025529', ...

tried it several time already on phpmyadmin with the same error message.

Hi LPS! thanks for your for that but unfortunately its not working i am just getting this error message.

Error in Processing Request

Error code: 504

Error text: Gateway Time-out

i also tried using left outer join with no avail.

Hi

Im having a hardtime making my query work the way it should be.i'm getting wrong output. basically what im trying to do is a simple user statistic that will show the user inputed data and user processed data base on the date range the user selected.

heres the screenshots for better visualization
1.jpg

and the query for that is.
first Get all the user from the user table

Select Name from user GROUP BY Name ORDER BY Name ASC

then i will loop inside the reservations table for the matching username base on the date range selected

select   
     SDate,
     FoName,
     COUNT( FoName ) AS 'opentrans' 
     From reservations 
     where SDate BETWEEN '" . $from . "'  AND '" . $to. "'
     AND FoName='$ngaran'
     GROUP BY FoName ORDER BY FoName ASC

after getting all the username available on that date range. i will loop inside table trans_logs to get all the proceesed/served transactions on that date range

Select username,status,
      SUM( IF(  status =  'Served', 1, 0 ) ) Served
      from trans_logs
      where datetime
      BETWEEN '" . $from . " 00:00'  AND '" . $to. " 23:59'
      and username='$ngaran' group by username order by username

I know that is not a great approach. but its the only closest thing in getting what i want. but i also tried using diffrent method the problem is that while im getting the correct result that i want i cant find a way to make the presentation of the data same as the original

what ...

Is your session ID set? try echoing for the value first if your really getting it.your file should start with a session_start() function for your session variable to work try adding it at line 2

Sorry for the late response been out for the holiday. so to cut the long story short, there are no possible way to decrypt any of the files without the KEY from the maniac. i already tried googling it but always come to a deadend. Yeah there is a backup but not really up to date.guess its better than to start from zero.

Thanks

P.S

If anybody found a way around it pls let me know.

Hi i just wanna know if there are way to decrypt a files that is infected and decrypted by a virus / malware? all of the files from one of the workstation are encryted as in totaly you cannot open the files.there is a noted in there saying that i need to pay a certain amount of money for them to give the decryption key. i already tried using some decrypter tools that i found and also tried uploading it to decryptcryptolocker.com in hopes that it can still be decrypt , i already scan the computer using a bootable antivirus, tried using system restore , i also attempted to open the files on a previous version(but dont have this features). all of my files came with this extension document.XLS.hrputzk

By the way the virus came from an email with an attachement which my ever thinking colleague open in hopes to have an International Bank account

Help needed badly

thanks

@ Revjim

thank you so much for that Snippet it really do the trick. learned new thing today and i cant believe that it is possible to access other db's with out using union or some other techniques

thanks

Neil

Hi everyone

i need some help down here. i am trying to connect multiple db and at the same time i want to sum the value of the column. what i have right now is this

SELECT SUM(total) as branch1sales FROM icm.sales 
UNION 
SELECT sum(total) as branch2sales FROM hism.sales

its computing correctly but the problem is the branch2 alias is being invoke. what am i doing wrong? see attached image for the output

Untitled.jpg

thanks

hi line 9 is fine the query is working when i insert a value directly to the query. its seems that the js is not passing the data to the php file. but the thing is the showdriver function is just a copy paste of the showplate function.doest xml request can only be pass once? but then they are different function im total lost.

Hi can anyone help me find what am i doing wrong. i have an xml request that check data on db and return the result. and base on that result it will clear or highlight a textbox. its working fine using the original function but when i add another xml request the function that i add don't work properly but the first function is working fine

my script

SHOWPLATE WORKING

function showplate(str)
{

    if (window.XMLHttpRequest)
        {// code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp=new XMLHttpRequest();
        }
        else
        {// code for IE6, IE5
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function()
        {

            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
            if (xmlhttp.responseText.trim()=="noplate")
                {

                   $("#platenumber").val('');

                    document.getElementById('submit').disabled = true;
                }
                else
                {

                    $("#platenumber").css({'border':'black 1px solid'});

                    document.getElementById('submit').disabled = false;
                }

            }
        }
      xmlhttp.open("GET","../fetch/checkplate.php?q="+str,true);
      xmlhttp.send();
};

THIS 1 NOT WORKING
function showdriver(dvr)
{

    if (window.XMLHttpRequest)
        {// code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp=new XMLHttpRequest();
        }
        else
        {// code for IE6, IE5
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function()
        {

            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
            if (xmlhttp.responseText.trim()=="nodriver")
                {

                   $("#driver").val('');

                    document.getElementById('submit').disabled = true;
                }
                else
                {

                    $("#driver").css({'border':'black 1px solid'});

                    document.getElementById('submit').disabled = false;
                }

            }
        }
      xmlhttp.open("GET","../fetch/checkdriver.php?d="+dvr,true);
      xmlhttp.send();

};

the checkdriver.php

<?php 
 require ("config.php");
$d= $GET["d"];
$d=trim(preg_replace('/\s+/',' ', $d));

    $driver="SELECT Name FROM guestname WHERE Name = '".$d."'";

    $sqld = $con->query($driver);
                if($sqld->num_rows > 0)
                {
                echo "yesdriver";
                }else{echo "nodriver";}

?>

the checkplate.php

<?php 
 require ("config.php");
$q= $_GET["q"];
$q=trim(preg_replace('/\s+/',' ', $q));

    $q="SELECT plateno FROM platenumber WHERE plateno = '".$q."'";

    $sql = $con->query($q);
                if($sql->num_rows > 0)
                {
                echo "yesplate";
                }else{echo "noplate";}

?>

Thanks guys!

Hi Thanks hericles and Pritaes both of you for the suggestion. UNION solved it all.

i came up with this

select Ra_num from DB1.processed_trans union all select Ra_num from DB2.processed_trans

now came the more pressing issue im trying to figure out.but because of your suggestion i think im on the right track already.

to tell you the truth i dont know what to use. can i achieve what i want tru UNION? i'll try to look at union then.

Hi

Im just trying to show all the Ra_num record from both database, there is no matching record that i can use for the ON. am i missing something? is there other way around it?

Hi need some insight on how to show record from different database on the same server. i also tried using join but didnt get the correct output. im finding a way to make it work using just one query. my last resort will be using different query to select the data i need(hope i wouldn't go that way)

what i have so far is this. it show the record of both database but somehow it repeating the same record

SELECT DB2.processed_trans.Ra_num , DB1.processed_trans.Ra_num FROM DB2.processed_trans JOIN DB1.processed_trans ;

thanks,

neil

Hi just a stupid question do you have a default timezone included or activated? if no include in it at the beginning your your code or activate it on your server.

date_default_timezone_set('Asia/Manila');
$date="10-10-2014";
$datetime1 = date_create(date('d - M - Y'));
$datetime2 = date_create($date);
$interval = date_diff($datetime1, $datetime2);
echo $diff = $interval->format('LISTED %R%a DAY(S) AGO');

hi check your form action you are sending your data in a .html file try making a .php file

you are assigning a number when you use = only. try Using == iN yOUr if statement not = like $row['roleID'] == 1

Hi one simple solution is use windows.confirm javascript just put your delete query inside the js like

<script>
    if (window.confirm('are you sure you want to delete this data?')) {

    .. your delete query    
    }else{
    do anything
    }
</script>

Hi you can use a condition statement inside your query that check whether your row contain the data that you wanna count..

SELECT
  COUNT(DISTINCT CASE WHEN approved = '0' THEN  id END) 'zero',  
  COUNT(DISTINCT CASE WHEN approved = '1' THEN  id END) 'ones'
FROM business_details

your script pls?

Can you post the connection.php? also change $_POST['password'] to $_POST['n_password'] as password is not define

from

if(isset($_POST['old_password']) && isset($_POST['password']) && isset($_POST['new_password']))

to

if(isset($_POST['old_password']) && isset($_POST['n_password']) && isset($_POST['new_password']))

try removing ". sign on line 97 like this and retry

$change_pass = "UPDATE users SET user_pass = '$new_pass' WHERE user_name = '$_SESSION[user_name]'";

An Ajax reload would be great

hi a simple solution to that is when the user click submit direct the user to your form.php and after the process in form.php is completed redirect the data from form.php to form1.php. you can use several approch to achieve this the most simple one is use GET to pass the data from form to form1 using the url which will look like this

form1.php?name=Michael Jordan&age=100

and another way is to use session like

form.php
<?php
session_start();

$name=$_SESSION['Sess_name'] = $_GET['name'];
$age=$_SESSION['Sess_age'] = $_GET['age'];

?>

 form1.php

    <?php 
    session_start();

   echo $_SESSION['Sess_name'];
   echo $_SESSION['Sess_age'];

    ?>

Hi Try something like this

$mysql_hostname="localhost";
$mysql_database="";
$mysql_user="";
$mysql_password="";

$con = mysqli_connect($mysql_hostname,$mysql_user, $mysql_password, $mysql_database);

$name=trim(mysql_real_escape_string($_POST['name']));

$sql=("CREATE TABLE IF NOT EXISTS `$name` ( `sender` varchar(30), `message` varchar(300), `dateposted` date )");

if (mysqli_query($con,$sql)) {
  echo "Table $name created successfully";
} else {
  echo "Error creating table: " . mysqli_error($con);
}

and refer to this link