Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Utorok, 13. október 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Triggers

phpMyEdit Features     Triggers
Odoslať novú tému   Odpovedať na tému    
 
JammerPro     Založený: 07.12.2006   Príspevky: 33  
Príspevok Zaslal: 2019-03-20 03:13
Návrat hore  Odpovedať s citátom     

This used to work in PHP 5.6, but not even close in PHP 7.0.

I am using a trigger file to look up the hourly rate of a client in a table called client from the field time_ (i.e. client.time_). Then, if the input of the user which is to go into another table called billing, in a field called wage (i.e. billing.wage) is identical to "Default Client Rate", the client.time_ value is to replace the billing.wage input.
I have echoed the output, and I am getting all variable values perfectly. However, the MySQL database is not entering the new value found in client.time_.

Here is the code:
Kód:

<?php
include('inc/dbconn.php');

$result = mysqli_query($db, "SELECT time_ FROM client WHERE client.id =$newvals[client]");//For Totals

$ratex = null;

if ($result) {
    while ($row = mysqli_fetch_array($result)) {
       $ratex = $row['time_'];
    }
}

echo $ratex; //I know this displays the client.time_ value for the selected clien because this echoes the proper value (a number).
echo "<br>";
echo $newvals['wage']; //I know this displays the billing.wage field value properly because it displays the selection "Default Client Rate"

if (($newvals['wage']) == ('Default Client Rate')) {

unset ($newvals['wage']);
$newvals['wage'] = $ratex;


//alternatively ---// $this->fdd['wage']['input']=$ratex;

echo "<br>";
echo $newvals['wage']; //This echoes the new value properly. Everything returns true BUT THE DATABASE DOES NOT UPDATE CORRECTLY!



} else {
   echo "Failed";
   }
return true;

// The triggers in the file are:
//$opts['triggers']['insert']['before'] = 'inc/triggers/default_client_charge.php';

//$opts['triggers']['update']['before'] = 'inc/triggers/default_client_charge.php';

?>



I am clueless as to why this no longer works... ANY HELP WOULD BE GREATLY APPRECIATED!

Thanks.

JammerPro


[/code]

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov