-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Calling a MSSQL Stored Procedure with multiple inputs and outputs
requinix replied to Thomas_Bode's topic in PHP Coding Help
Have you tried adding more? -
What code have you written so far, what did it do, and what did you expect it to do?
-
PHP script to export for Facebook data feed CSV
requinix replied to ludwig's topic in PHP Coding Help
Don't write CSV lines yourself. Use fputcsv. -
Also, the warning is during compilation, which makes it a E_COMPILE_WARNING and not a regular runtime E_WARNING.
-
error_reporting() won't help you if there is an error detected while parsing the file that the code is in. In this case, since there is no other file where you could put the function call, set the error reporting you want with a CLI option. You know what's even better though? Fixing the problem the warning is telling you about.
-
Ratings in database ala Amazon. How many of each?
requinix replied to tunnelboy's topic in MySQL Help
Does it have to be in your results? It would be really easy to just write a tiny bit of code that uses 0 if there aren't any ratings of a particular star count. -
Notice: Trying to access array offset on value of type null in
requinix replied to Flatronez's topic in PHP Coding Help
Those two lines assume that something exists in $cellt when it, apparently, does not. Hard to tell why or what's going on from just this code... Is everything behaving the way you expect it to, besides the notices? -
If they're separate from each other then why are you altering the line-height? And is this visible somewhere we can see for ourselves?
-
Not sure what markup you have, but the simplest solution seems to be putting the two lines into their own elements and positioning those as you want.
-
How about a screenshot/image of what "close in" means?
-
Smarty template & PHP 8.1, TEXT: Function strftime() is deprecated
requinix replied to ohno's topic in PHP Coding Help
Huh, it's actually doing the thing I thought it wasn't... Only thing left I can think of would be skipping E_DEPRECATED messages. set_error_handler("error_handler", E_ALL & ~E_DEPRECATED); -
Smarty template & PHP 8.1, TEXT: Function strftime() is deprecated
requinix replied to ohno's topic in PHP Coding Help
Given how dumb Smarty wants to be about this, suppressing the error looks like the only option. And since they're already doing that, I suspect you have a custom error handler? What's the code for that? -
I'll give this one more try: 1. I've already mentioned that include() will return a boolean. Specifically, true if it was able to include the file and false if it was not. 2. You are using <?= tags instead of regular <?php. Remind yourself of what the special <?= form does. Do you know what happens when you combine those two together?
-
Post a sample of one of the times you did an include() that did not have this "1" problem.
-
Look closer at what you have here <?=include '../subscribe/sub_countdown.php'?> and compare it to the other times you've done something similar.
-
<?=include '../subscribe/sub_countdown.php'?> include() returns a boolean.
-
sidebar just click and the text always hides when it should
requinix replied to egemen's topic in Javascript Help
Do not translate things like keywords } Başka { // else fonksiyon aa(){ // function aa or CSS 60 piksel /* 60px */ görünürlük: gizli;görüntü: yok; /* visibility: hidden; image: none; */ or events dc.addEventListener("tıklayın", dd); // click You can write in Turkish names when you are the one creating them - names like for variables or functions. -
If you need a single array then you'll have to do away with the prices objects and re-bundle their data into arrays. array( 0 => array( "prd" => 2380, "id" => "173489", "price" => "65.00", "stores" => array( "store 1", "store 2" ) ) ) Unless your spreadsheet builder thing is a pain, you could take that 0 => array and re-key it to the prd as 2380 => array. Similar to before, you can then use the prd every time to insert-or-update into this larger array: insert when there is no existing [2380] yet, update with array[2380]["stores"][] = "store 2" when it does exist.
-
Then that makes it a little easier. Figure out which of prid and id is the unique identifier - they probably aren't both equally unique because then why would there be two of them? - and use that for your array keys. You end up with arrays that look like $allPrices = [ // picking id, 173489 => prices { #2698 #container... } ]; $pricesToStores = [ 173489 => [ 'store 1', 'store 2' ] ]; That keeps the prices objects in one place, and using the prid/id as the keys in both places means you can easily look up which stores any one is associated with.
-
1. You need an array to put all the data you're receiving. $newArray isn't the greatest name but it'll work for the moment. 2. For each price item you receive from the API, check if you have it in that array already: if so then update its list of stores, otherwise add it. It looks like $Data is: an array of prices, where each price is a "prices" object, and that object has a private "container" array of the data. The problem here is that you can't (nor, in fact, should) add anything to that container array: it pollutes the concept of the "prices" object with data it doesn't know about. In your shoes, I think I would change the above approach to be: you have two arrays, one of all the prices with no store data, and another that tells you which prices are in which store. The new approach is: 1. You need the one array for all the data - let's say "$allPrices". You need a second array just to associate prices with stores - let's say "$pricesToStores". 2. For each price item you receive from the API, add it to $allPrices. Because there will be duplicates, don't add it blindly but instead index the array by the unique identifier; that'll be either the "prd" or the "id", I can't tell. 3. At the same time, add information to $pricesToStores for the price item and the store. They should be indexed by the prd/id as well, and the array values can be the set of stores it was found in. There's probably a small issue though: when two stores have the same item, is the data for those two items exactly the same? I think not. My guess is that the "prd" will be the same but the "id" will not (or vice versa). If you simply keep one of the prices in $allPrices then you lose what the other ones were, so perhaps you might need to retain all the prices together in a sub-array. But if you have to do that, does the price data mention which store it came from already? Because if it does then the $pricesToStores array is pointless. So after all that, a question: what does the price data look like for 2+ stores that have the "same" one?
-
My guess: because you're relying on elements IDs instead of classes. Can only use an ID once per page.
-
how to launch an attack on the detection of a brute force attack?
requinix replied to alexandre's topic in PHP Coding Help
No. That's not possible. How much further down this rabbit hole are you going to go? -
how to launch an attack on the detection of a brute force attack?
requinix replied to alexandre's topic in PHP Coding Help
Don't. It won't accomplish anything.