Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Again, you cannot be serious. You have got a specific data definition that you didn't bother to share and some specific code that is processing that and you somehow want help with how it is sorting without showing anyone here that information?
  2. You have got to be kidding... You are already iterating over the values. Just remove the sort function.
  3. Then simply iterate over the array. No sorting is necessary.
  4. What you do to fix a problem is dependent on what the problem is. Do you have a specific example (for all we can tell the $this-> in your code is there because it IS part of a class and your script is not working due to some other problem.)
  5. Your select menu has name="manufacture". The submitted value would be in $_POST['manufacture']
  6. If you want to get the id of the row that was just inserted by the current visitor in your script, you need to add an auto-increment field to your table.
  7. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=312037.0
  8. Where is your code that is setting $manufactures ?
  9. If your question is actually to get the eid's that have cid's with only both values (not just one of the values), you would need to use a HAVING COUNT() = 2 in it, along with the OR (which is the same as an IN()). Untested but should work - SELECT eid, count(*) as cnt FROM table WHERE cid IN(1,3) GROUP BY eid HAVING cnt =2; You can also use a self join, but I don't recall how to do that off of the top of my head.
  10. Your query has 2 WHERE clauses, so it produces a sql syntax error. If your query is in fact - SELECT eid FROM table WHERE cid = 1 AND cid = 3; It won't match any rows because the WHERE clasue is always FALSE because cid cannot have more than one value in any row. OR is correct because it matches the rows WHERE cid =1 OR cid =3. The WHERE clause is TRUE for the rows with 1 and 3.
  11. Since the code you posted for insertvalues.php contains two fatal parse errors, I seriously doubt that is the actual code you are using.
  12. The name of your submit form field is - name="submit" You would need to test if that same name is set in your php code. $_POST['Submit'] is not the same as $_POST['submit]
  13. And using stripslashes(mysql_real_escape_string(...)) would remove any escaping and make your code open to sql injection.
  14. You can as long as your php syntax is correct. You are missing a semi-colon ; on the end of the line of code right before the second while() statement.
  15. Based on the query you posted that gets the data and using the $data array that I showed, the following would produce a query that updates the row with any data in the array - $query = "UPDATE combat SET "; foreach($data as $key => $value){ $value = implode(';',$value); $query .= "$key = '$value',"; } $query = rtrim($query,','); $query .= " WHERE combatID='$other[7]'"; // execute your query here... echo $query;
  16. How would anyone here be able to tell you if that query is correct or not. You are the only one here who knows what your table definition is. And that's not a suggestion to post you table definition. It's a suggestion for you to troubleshoot what your code and query are doing on your server and with your database. Fix your code that is using mysql_error() and it will tell you why the query is failing.
  17. Yes, but you didn't state what you are trying to accomplish, nor did you show example data and the expected results vs the current results.
  18. In the main code you posted, $query is the query string and it is set, so your conditional code you just posted will always be false and will never echo mysql_error().
  19. HOW are you using mysql_error()? You would need to echo it to see any error it returned. What output or symptom are you getting when you request the page? Have you successfully executing any mysql_query() statement on the server?
  20. PFMaBiSmAd

    power outage

    I would rent or borrow a small backup generator and power the minimum necessary equipment to keep your site online.
  21. You basically have two bytes per character, the upper byte being all zero bits, with an extra null byte at the start of the string. What is producing that data? Any chance that your code prior to that point is doing that? Another possibility is that you are transferring the file in binary mode instead of ascii mode.
  22. You would need to get that from the owner of the site or the author of the script. Think about it, if anyone could get the source php code for a page on a site, that would make all the sites using php open to attack because it would expose things like database login details, smtp authorization credentials, and security holes in the scripts. Given that there is such a huge amount of php code examples published all over the Internet, why would you need to get the source php code for a random email.php script?
  23. It doesn't do us any good to just tell us some code doesn't work. We already know that because you wouldn't be posting on a programming help forum if your code worked. You have got to tell us what you see in front of you when you tried it. You could be getting a blank page, a php error, a mysql error, an error message from the application or any number of other symptoms that would tell us what might be the problem with your code on your server with your database.
  24. The server's time setting is ~ 5 minutes off. In my timezone, this post was made at 7:09 AM, the time shown on the post is 7:15:xx AM.
  25. ^^^ That's the same problem that I see using FF
×
×
  • 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.