-
Posts
15,289 -
Joined
-
Last visited
-
Days Won
436
Everything posted by requinix
-
LEFT JOIN users LEFT JOIN timesheets ON st.time_id ON users.user_id = timesheets.timesheet_id Want to give that another shot?
- 19 replies
-
- php
- time calculations
-
(and 1 more)
Tagged with:
-
Setting POSTFIELDS to an array means cURL will encode your data in the "multipart" format. Apparently FindByBVN2 does not like that. If you're supposed to send JSON data then you have to send JSON data.
-
Either you or MAMP would have set up that user and its password. I think that information is available somewhere in phpMyAdmin. Try logging into phpMyAdmin with those credentials and seeing what happens.
-
That would be due to the % 24 you have in the $hours code. There is no error message "undefined array key". Do you mean "undefined offset"? If it says that the undefined offset was $mondiff then that means somewhere, presumably on the line of the file that was identified by the error message, something that looks like $variable['$mondiff'] If you meant "undefined variable" then that would be surprising because the only two places in the code you posted that attempt to use that variable do so by expecting the variable is an object and calling a method on it - something that would not simply report "undefined variable" but instead cause a fatal error/exception about attempting to call a method on a non-object.
- 19 replies
-
- php
- time calculations
-
(and 1 more)
Tagged with:
-
PHP won't be doing any weird things like returning from copy() when it's only partially done, so don't go chasing those white rabbits. It's likely to be a filesystem issue. You talk about copying files between servers but presumably you mean that there's an NFS mount (or similar) on the local machine that is hosted by the remote machine? Could there be syncing problems? Have you tried reproducing this problem without PHP? Copying files yourself from a shell, or even another language (eg, Python)?
-
Is MySQL running? On port 8889? Is the username and password correct? Does the database exist? Does the user have permission to access it? Did you look at the exception in $e to see if that might have useful information?
-
9am to 5pm minus one hour of break = 7 hours. Great. So what was that code?
- 19 replies
-
- php
- time calculations
-
(and 1 more)
Tagged with:
-
What exact inputs did you give for the various fields? By... writing code that says "if the field is empty then don't do stuff"?
- 19 replies
-
- php
- time calculations
-
(and 1 more)
Tagged with:
-
Is it actually causing you problems? I mean real problems? Because JSON allows for escaped slashes like that.
-
I don't know where the textboxes are, but that might not matter. The simplest method to make this work would be to save all the rows by using a loop to find all the rows and update each one individually. That's okay if you don't have many rows. If you do have many rows then you'll have to make some more significant changes. The first one would be making modify_records.php able to update multiple records at once...
-
Okay. What code have you written so far? What have you tried changing to make it work with one save button for them all?
-
FileZilla Pro 3.55.1 Keyboard short key
requinix replied to LeonLatex's topic in Editor Help (PhpStorm, VS Code, etc)
https://www.google.com/search?q=filezilla+keyboard+shortcuts- 1 reply
-
- 1
-
-
Error with an old Wordpress Template upgrade to PHP 8
requinix replied to Kargano's topic in Third Party Scripts
#2 /****/****.com/rebuild.****.com/wp-content/themes/oldtheme/library/widgets.php(255): register_widget('VMenuWidget') That code seems to be incorrect because VMenuWidget does not have a __construct which the WordPress documentation says it needs to have. See if there's an update to whatever theme to be compatible with recent WP versions. -
Error with an old Wordpress Template upgrade to PHP 8
requinix replied to Kargano's topic in Third Party Scripts
What version of WordPress are you using? Is it at least 5.6, which is when they added support for PHP 8? -
Error with an old Wordpress Template upgrade to PHP 8
requinix replied to Kargano's topic in Third Party Scripts
The error is that some code is calling a function with the wrong number of arguments. The two function calls in the code you think seem to be correct. There should have been an exact filename and line number in the error for the calling code. That will tell you where to look. Then check what function(s) it's trying to call and why it's doing so incorrectly. -
The Item class should be responsible solely for the logic of an item. It should not have anything to do with determining what webpage was accessed, nor should it do anything with creating HTML markup. Those are responsibilities for other code.
-
That ^ was a hint.
-
Kinda sounds like you're saying that this if check would go in the Item class. That is not the case, right? You're talking about putting the code in some other file, right?
-
PHP - Database Searchfunction doesn't work as intented
requinix replied to KN1V3S's topic in PHP Coding Help
Compare this if(ISSET($_POST['search'])){ $valueToSearch = $_POST['suchfilter']; with this <form> If you're still unsure, try describing to yourself precisely how a <form> submits its data to the server. -
Virtually every editor out there can support PHP and SQL files. However, defining "support" is a trickier question, as it can be anything from highlighting to syntax checking to autocomplete, and different people want different options in their editor.
-
That's the code for printDiv but obviously Javascript doesn't think you've defined it. Which could mean anything from that code living in a completely irrelevant file to that function being defined inside of some other code that hasn't run and/or runs in a different context than the window. Hard to say which without knowing more.
-
wordpress Show only if user-role is subscriber AND site visitor
requinix replied to heathcliff's topic in PHP Coding Help
array_intersect will tell you the items that were present in both arrays. All you're doing now is ensuring that the array it returns is not empty - it has at least one of the two roles. If you want to require both roles then you can (a) use array_diff or (b) continue with array_intersect but count the number of shared roles it found. -
Then what are you "updating"? Also, number_format($values["product_quantity"] * $values["product_price"], 2) don't do that. I know you think you won't deal with figures above 1000 but number_format will add commas ("1,000") which PHP will not be able to reverse into a regular number. If you want to show a formatted number then go ahead and do that, but the value itself has to be unformatted. Which brings us back to the "what are you updating" question.
-
Tip: if PHP is complaining about a specific line in a specific file where you are calling count() incorrectly then you should probably post that specific file with its specific line. As well as everything that's between it and this get() where you believe the problem is.
-
Next time, please post all of your code intact instead of extracting the pieces you think are relevant. That said, with some educated guesses to fill in the blanks, If your HTML form is including lots of rows to update, you can't give every "product name" field the same "prod_name" field. It's like you wrote code $prod_name = "First product"; $prod_name = "Second product"; $prod_name = "Third product"; Think about it: what's $prod_name going to be? Use [ ]s in your form field names to create arrays, similar to the code $prod_name[] = "First product"; $prod_name[] = "Second product"; $prod_name[] = "Third product"; In this case, I would suggest using the product_ids (is it just one ID, right?) as one array key, then "product_name" and such as secondary array keys. Means you can remove the hidden prod_id field too. '<td><input type="text" class="form-control" readonly name="products['.$values["product_ids"].'][prod_name]" value="'.$values["product_name"].'" /></td>' But... the fields are readonly?