0

Ok because I do not fully understand from which directory you are calling your scripts, let's make clear we're on the same line here :).

So let's say you have directory C:\wamp\www\x. In x, you have src\autoload.php, i.e. C:\wamp\www\x\src\autoload.php. So when you are now inside directory x in your terminal, calling phpunit --bootstrap src/autoload.php tests/MoneyTest directs to folder src in your current folder, and to autoload.php in the src folder. Is this what you are trying, and is this where you are getting your "autoload.php cannot be opened" message?

0

Your code with comment:

$myarray = array();
$myarray['numbers']=$_POST['numbers'];
foreach($myarray as $num){
       $numbers=$num; // You aren't creating an array here. You are giving $numbers the value of the CURRENT number in the loop. PLUS your numbers are stored in $myarray['numbers'], not in $myarray ;).
}
$unique = array_unique($numbers); 
$output=implode("<br />",$unique);

What it should be:

// Assign $_POST['numbers'] to $numbers if it exists, otherwise make it an empty array.
$numbers = !empty($_POST['numbers']) ? $_POST['numbers'] : array();

// Output the result.
$output = implode('<br>', array_unique($numbers));

Nice find on the array_unique by the way :). If you need more explanation, let me know! Some explanation on the $var = $condition ? true : false line I used:

// This line..
$numbers = !empty($_POST['numbers']) ? $_POST['numbers'] : array();

// ..is shortcode for:
if (!empty($_POST['numbers'])) {
    $numbers = $_POST['numbers'];
}
else {
    $numbers = array();
}
0

You can't specify target table 'telefonisti_podaci' for update in FROM claus

This looks like a non-default MySQL error. Maybe it's a custom error triggered by your CustomQuery function? If so, then you could check that function to see when and thus why it is thrown/given.

1

Ok, this is confusing me somewhat: your file is in the list with included files, but if you output text inside that include file, it isn't being shown on the screen? Or does output get shown on the screen, and is it the "false" that is generated by var_dump(function_exists('Get_Favourites'));? Have you tried using different spelling for your function name and checking (with the function_exists() function) if the function does get defined properly with that spelling?

0

In addition to my answer, you can measure how long actions take by using - for example - the microtime function. Example:

// ----- ACTION 1: -----

$start = microtime(true);

for ($i = 0; $i < 9999; $i++) {
    // Perform action 1.
}

$end = microtime(true) - $start;
$avg_time_per_action_1 = $end / 9999;

// ----- ACTION 2: -----

$start = microtime(true);

for ($i = 0; $i < 9999; $i++) {
    // Perform action 2.
}

$end = microtime(true) - $start;
$avg_time_per_action_2 = $end / 9999;

// ----- RESULTS: -----
echo 'Avg time 1: ' . $avg_time_per_action_1 . ', 2: ' . $avg_time_per_action_2 . '<br>';
1

Well, usually an update query takes longer than a select query because an update query locks the database where a select query does not. Therefore, if you can avoid an update query by running a select query, it might do good to your app's performance. You will need to have use case statistics, however, to see how many times values actually remain unchanged, what the difference in impact is for both scenarios, etc., to be able to give a true answer to your question.

1

So if you add an echo to the file that defines your Get_Favourites() function, and then include that file, nothing is being echo'd to the screen? E.g. if you add echo 'Hey, you\'ve just included me!';, it doesn't show on the screen? Because if that is the case, you simply need to make sure that your file is properly included.