-
Posts
15,292 -
Joined
-
Last visited
-
Days Won
436
Everything posted by requinix
-
php excell search for string and return cell value = a12
requinix replied to Paulqvz's topic in PHP Coding Help
Pay very close attention to the question and try to answer it directly: Does getActiveSheet() return multiple values? -
An infinite loop and a runaway recursive algorithm spawning cloud resources to process its workload are two very different things. Much harder to believe that the former could create a $72K cloud bill than the latter. I'm just going to side-step the whole issue of you not understanding how CPU usage works, and move on to the answer: if you have to worry about micro-optimizing your PHP code to minimize the number of CPU cycles then you do not have the budget to afford the cloud. Buy some traditional, dedicated site hosting package instead.
-
php excell search for string and return cell value = a12
requinix replied to Paulqvz's topic in PHP Coding Help
You're correct, that code does try to search the active worksheet for a cell containing a value. -
php excell search for string and return cell value = a12
requinix replied to Paulqvz's topic in PHP Coding Help
foreach ($objPHPExcel->getActiveSheet() as $worksheet) { foreach is only for multiple values. Does getActiveSheet() return multiple values? I don't see anything in your code that tries to do this. If you need help making code work then you're going to have to post the code. -
How do I highlight mysql fetch dates in a datepicker?
requinix replied to imgrooot's topic in PHP Coding Help
I don't know what you think, but that is not a date. That's a bunch of numbers and hyphens. Would you expect this $.post('snippets/adapter-fetch.php', {}, function(data) { $("#datetimepicker1").datepicker({ datesEnabled : "2021-06-022021-06-032021-06-01" }); }); to work? Keep thinking in that direction for a few minutes and see what you can come up with. -
How do I highlight mysql fetch dates in a datepicker?
requinix replied to imgrooot's topic in PHP Coding Help
Exactly what did the alert show? Or change your alert to a console.log and copy/paste what you get in the console. -
How do I highlight mysql fetch dates in a datepicker?
requinix replied to imgrooot's topic in PHP Coding Help
Definitely not the correct syntax. You familiar with Javascript much? May be worth spending an hour or two learning about it. -
How do I highlight mysql fetch dates in a datepicker?
requinix replied to imgrooot's topic in PHP Coding Help
Have you looked at what output adapter-fetch.php is returning? -
I believe people felt the same way about their horse and buggy when Ford introduced the car.
-
You cannot combine PHP code and Javascript code. Fundamental concept, that. You can use PHP code to output Javascript code. Such as a line of code that sets a variable. Then your Javascript code could use that variable to decide whether to mark the option as selected. But really, document.write? What is this? The '90s?
-
There could be some minor differences based on how the system actually works, but yes: that's more or less correct. If the result of submitting the form is only showing a picture then it'll probably be easier if you don't use a new page: 1. Submit the form data through AJAX. 2. As that request begins processing, use some sort of busy placeholder (modern designs have spinning circles) where the image will appear so the user knows something is happening. You'll also probably want to prevent additional form submissions, such as disabling the submit button. 3. When the request completes it returns the image. That could be a URL or it could be a raw image. 4. Put that image where the placeholder was.
- 2 replies
-
- swirly crap
- loaders
-
(and 1 more)
Tagged with:
-
Use a "remember me" cookie: the session cookie continues to do what it's doing now, and you set another cookie (which may live up to 4 months) that can be used to log the user back in automatically.
-
I'm sure you noticed, but you're counting from 0 to 42. Should be easy to change to count from 1 to 100, right? So you can list out all the numbers you want to output a message after, but you have to list them all out. What if you needed a loop from 1 to 1000? Or a million? What would you do then? You want to output at 5, 10, 15, etc. In other words, numbers divisible by 5. Have you tried looking for a solution using something that can tell you if a number is divisible by 5?
-
Best browser with the best tools for PHP development?
requinix replied to sen5241b's topic in PHP Coding Help
All the major browsers have more-or-less the same tools available. Question is which ones feel more natural to you. But that's mostly for frontend work with HTML, CSS, and even Javascript to an extent. Tends not to matter a whole lot for PHP - unless you count troubleshooting PHP's output, of course. -
Also known as a CSS reset. Not as common nowadays since browsers have been better at getting their acts together, but still around. If you want something that feels like a table then you probably want the Grid layout that Strider64 mentioned. Flex and CSS 3 also have some tricks you may not be aware of.
-
Prepare for the most likely scenario. If something were to break, would it probably be the API or the database query? I would think the API. That suggests you do it before the query; if the query fails then you undo the API call, and if that call fails (perhaps you lost network connectivity between the API call and query) then you log what happened and let a human deal with it.
-
Will this whole problem go away once validation is implemented? My position? Database rules to enforce data integrity, mostly with uniqueness and foreign keys. No code should ever be able to leave the database in an invalid state - incomplete, perhaps, but never invalid. Application rules to enforce business decisions. Opinions change quickly and it's better to deal with that in code. Databases should not be modified unless the structural nature of its data has to change.
-
What code have you tried so far, and what kind of problem (if any) are you having with it?
-
The only real "best practice" is to use as little and as simple CSS as necessary to get the desired end result. The two main answers here are typically either (a) padding on the HTML or (b) margin on the BODY. You could use DIVs but that tends to make it more complicated. Which you use depends on the rest of your CSS, especially whether you already do anything to the HTML and/or BODY elements, but a margin on the BODY tends to conflict less with other styling.
-
What's the best way to create a booking calendar system?
requinix replied to imgrooot's topic in PHP Coding Help
If you only care about checking individual dates that are available, that's fairly easy: store the unavailability dates as rows of start and end dates, then search for rows based on whether the day is between them. If you care about checking date ranges then it's a bit trickier, but still not as complicated as it might sound: a conflict is any row where the desired start date is before the unavailable end date, and the desired end date is after the unavailable start date. -
In general, try to use z-index as little as possible. How is overflow configured on the parent row? If it isn't allowed then the arrow will clip when you try to position it partly out of bounds.
-
A screenshot isn't the most helpful thing. Got a link to the webpage?
-
That comes from $sql2 = " SELECT order_id FROM ordered_items GROUP BY order_id WHERE order_id = '".$row[order_id]."' "; this query. So if this query isn't working then your next step is to learn more about $row.