Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. And the problem is??? Besides the fact that you have a variable inside single quotes?
  2. is pmcount supposed to be a number? if so you can just cast it as an int, and not quote it. Same with $id.
  3. the item() call will return NULL if there is no item at that index. $pols = $doc->getElementsByTagName('Policies')->item(0); if($pols == NULL){ die('No element found'); }else{ $policy = $doc->createElement('Policy'); $pols->appendChild($policy); }
  4. Why don't you just do group by field1?
  5. In the future, don't post your entire code, just the relevant part. When you get an error, it's important to look at the line before it as well. Line 170 is <?php endif ; ?> You have an errant space. I don't know if that's what's causing it. Your code has too many open/close tags and poor indentation to see if there's really a matching while. You have three opening whiles and three endwhiles but it's hard to tell if they all line up because of the erratic indenting.
  6. Alphanumerically, AB51MN50.jpg should come after AB51MN175eue.gif You need natural case sorting, but even that may not do it. AB51MN1... AB51MN5... See?
  7. You don't DELETE *, you just DELETE.
  8. This topic has been moved to JavaScript Help. http://forums.phpfreaks.com/index.php?topic=364893.0
  9. I don't think you should be suppressing the error. Also by assigning the result back to $query you lose your statement for debugging. Try it like this, so you can see the whole query not just the part that mysql tells you. function db_query($query) { $result = mysql_query($query) OR die("Error running query(" . $query . "): " . mysql_error()); return $result; } There doesn't seem to be any problem with the query that I see.
  10. This topic has been moved to JavaScript Help. http://forums.phpfreaks.com/index.php?topic=364887.0
  11. But you said when you echo $site it shows the value? And there's no other code?
  12. change header("Location: locationinfo.php?id=$site&updated=1"); to die("Location: locationinfo.php?id=$site&updated=1"); what does it print? Once you get this fixed you need to read about SQL injection, btw.
  13. If the output of the print_r you posted is what you really got, then yes that will work. If it doesn't, post your updated code so we can see.
  14. So, you can see from your results that $assetresult is a multidimensional array, not an object. First, you need to turn on error_reporting set to E_ALL. Secondly, look if your DB library has docs on how to handle results. You'll either need to use some functions from the library, or do $site = $assetresult[0]['currentjob'];
  15. What db library are you using? do a print_r($assetresult);
  16. $correct = array("APNG","TIFF","RAW","BMP","SVG","WEBP","EXIF","PNM","PBM","PGM","PPM"); $check = array('PGM','TIFF'); $in_first = count(array_intersect($correct, $check)); echo "You have $count correct!"; Not tested.
  17. Whatever site you are trying to trick probably has a rule against this. If what you were trying to do was allowed, they would have an easy way for you to do it.
  18. $place = file_get_contents('http://api.hostip.info/country.php?ip='.$country); If you would use proper code tags, and in the future post the actual error, that will be good.
  19. You would have to have the browser force a download of the file. Then if you want your site to be able to use it again, the user would have to upload it. Why are you trying to do it this way?
  20. This is a problem with Excel, you're talking about the number being shown in scientific notation, right? The only trick I've found is to make sure it's a string, by putting quotes around it. Quotes in the output.
  21. I can't speak as to why the update takes so long, but if you add indexes it should help. This is a one time thing, right?
  22. The update looks fine to me. Your select however will produce duplicate results because you are joining every row in users to every row in zip codes. You haven't told it how to join. When you join you need to specify ON what column, like you did in your update. You can also make it an inner if every row in users has a matching row in zip codes. Inner is faster than left. And add indexes!!
  23. The first thing you should do is fix the name of your function to search instead of serach. Secondly, start capturing errors, look at the examples on the manual. http://us2.php.net/mysql_query
×
×
  • 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.