Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Oh, so you're trying to prevent more duplicates.
  2. Right... and you should always have the link. If not then you don't know what is a duplicate of what. So, what do you mean if it "does not exist"?
  3. It seemed like a one-time thing; if not then there are larger problems that need to be addressed. If Link is NULL then the GROUP BY won't work. That's what you were using to de-duplicate. So what do you mean if it "does not exist"?
  4. Can't delete from a table and pull data from it at the same time. Quick solution: use a temporary table. CREATE TEMPORARY TABLE fooTableName LIKE TableName; INSERT INTO fooTableName SELECT * FROM TableName; DELETE FROM TableName WHERE ID NOT IN (SELECT MAX(ID) FROM fooTableName GROUP BY Link HAVING MAX(ID) IS NOT NULL); DROP TEMPORARY TABLE fooTableName;Not quite as nice if TableName has a lot of rows. Definitely not as nice if bad data is still being added into TableName (and if so then you need to fix that before doing this). Side comment: HAVING MAX(ID) IS NOT NULL only matters if your ID can be null. Surely something called "ID" cannot be null, right?
  5. Twilio is the most popular service and can do exactly what you want.
  6. What kind of answer are you actually expecting to get? Are you going to install one on your phone and you don't know which to use? Are you trying to design a mobile website and you want to know what most people are using on their device? Or are you just throwing out questions that sound relevant but are actually meaningless in order to increase your post count?
  7. First there's a problem: 'title' => 'FABLife', 'desc' => 'Mark Cuban (``Shark Tank\'\'); top five must-haves; collectors try to guess the prices of celebrity memorabilia; creating a high-end playroom and eliminating toy clutter without breaking the bank.', 'title' => 'The First 48', 'desc' => 'A young man is robbed and killed while meeting up with a girl he met earlier; a man is gunned down outside an annual football game.', 'title' => 'Teen Titans Go!', 'desc' => 'Robin makes the other Titans sell their treasured mementos from past adventures.',Can't do that. There can only be one "title" and "desc" in the array. You need to come up with a different way of representing everything. I suggest 'info' => array( array( 'title' => 'FABLife', 'desc' => 'Mark Cuban (``Shark Tank\'\'); top five must-haves; collectors try to guess the prices of celebrity memorabilia; creating a high-end playroom and eliminating toy clutter without breaking the bank.' ), array( 'title' => 'The First 48', 'desc' => 'A young man is robbed and killed while meeting up with a girl he met earlier; a man is gunned down outside an annual football game.' ), array( 'title' => 'Teen Titans Go!', 'desc' => 'Robin makes the other Titans sell their treasured mementos from past adventures.' ) )
  8. That's a PHP thing, not a Javascript thing. Make sure you have the most recent version of elFinder - they may have fixed this already. Otherwise I suggest fixing the problem in the actual code. You'd have to post what's in elFinder.php around lines 300-350.
  9. Inside the foreach loop you have to use $entry. $xml->entry-> will only get you stuff from the first .
  10. Uh, no. You'd use a form. As in <form action="page.php" method="post"> <input type="hidden" name="id or whatever" value="1"> <button type="submit">Delete</button> </form>
  11. What is the name of the actual file containing the code? And did the .htaccess thing work for you or not?
  12. ... 1. salesperson_delete.php has nothing to do with admin_subfile_delete.php. Just because "id" in one file means a salesperson doesn't mean "id" anywhere must only be a salesperson. 2. You know you can put whatever you want in the query string, right? You could call the sales ID "sales_id" or "sid" or "potato", it doesn't matter.
  13. Most people don't want to download attachments and fire up a PHP editor to read someone's code online. In the future, help us all out by posting the code right in the post itself. (I've done it for you this time.) // if not set, send back to agreement echo ' <a href="https://www.macreon.com.au/WholesaleAgree.php"></a>';All you're doing here is outputting a link to the agreement page. You have to actually force the user to go back to it, and you do that with code like // if not set, send back to agreement header('Location: WholesaleAgree.php', true, 307); exit;This tells the browser to redirect, the 307 means it's only a temporary redirect, and the exit prevents the rest of the code from executing. Keep in mind that code that uses header() like this must happen before there is any output whatsoever. [edit] Oh. You're also missing a check for the acceptance flag in the session. All you look at now is the form - gotta check both of them.
  14. I take it your example desired output is demonstrating the total_population_change value and should show that for all dates (except the first per player) and not just those two? There's a pure SQL solution to this, and I think it would work more nicely than the PHP alternative, so I'll move the thread over there.
  15. Is awr100-1322.php an actual PHP file? Or what? What is the file with this $CODE stuff?
  16. You get the values from AJAX and then put them into the , right? Or something like that? Somehow you start with the array like you first posted and then turn it into the list. Whatever the method is, you do have both the label and the value so you should be producing list items like label
  17. The value of that metals thing is the value of the selected option. So "-" or "bronze" or "silver" or "gold". If you want the value to be a number then make the value be a number. <option value="0">-</option> <option value="5">bronze</option> <option value="10">silver</option> <option value="15">gold</option>
  18. You would test it by... putting the stuff in place, writing code, and seeing if it works. Did you put that stuff in a .htaccess file in your website directory? Is your local setup and your web host configured to allow using .htaccess files at all? Easy way to check that second question is to put asdfstuff in the .htaccess and seeing what happens to your site: if your site loads then .htaccess isn't being used and you need to deal with that, and if not then remove that stuff because it is being used.
  19. If you have Apache and shared hosting (ie, you don't control the system) then yes, you'd use a .htaccess with mod_rewrite rules. Looks like RewriteEngine on # only match if the requested file doesn't exist RewriteCond %{REQUEST_FILENAME} !-f # only match if the requested directory doesn't exist RewriteCond %{REQUEST_FILENAME} !-d # rewrite 123.php to page.php?id=123 and stop processing RewriteRule ^(\d+)\.php$ page.php?id=$1 [L]Though the two RewriteConds probably aren't even necessary.
  20. So you're doing 400+ API calls on this page? It's going to be slow - no way around that. Even if each call took only 100ms (which includes sending the request, the server processing data, and then it sending the response back), that's 40 seconds to do all of them. Why do you need so many galleries' data at once?
  21. Well, I can't speak to WordPress stuff (I hate it) so... Use your browser to find out what is happening when that AJAX request gets fired off. For example, Chrome has a Network tab in the inspector/console thing (hit F12) that can show you not just that the request was sent, but what data was sent and what the server returned. Odds are you're getting a 403 Forbidden (may be a WP configuration issue) or a 404 Not Found (using the wrong URL) response from the server, and neither of those will trigger the success callback.
  22. Sure. It's called URL rewriting. What actually happens is requests for /654321.php transparently (user doesn't know) get rewritten to something like /page.php?code=654321. Then you can get your $CODE from the $_GET array.
  23. "Can't get" what? Does the AJAX not happen? Does it happen but the data doesn't get deleted in the database?
  24. Your input is named "user_file" but your code (which I'm sure has other problems besides this) is looking for "uploadedfile".
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.