Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. Then it sounds like no rows are being returned. $qP = "SELECT * FROM players WHERE id = '$getid' "; $rsP = mysql_query($qP); if (mysql_num_rows($rsP) == 1) { $row = mysql_fetch_assoc($rsP); $row = array_map('trim', $row); extract($row); } else { echo 'no rows returned'; } Also with my code, you don't need to explicitly do all that trim stuff - it is automatically done to all of the results.
  2. The backslashes need to be there because he used double quotes on the whole string. In fact, that isn't even part of the error. Maybe it's just late but I don't see any syntax error. *shrug*
  3. 1. Usually it's best to either crop or resize while maintaining aspect ratios. Otherwise, it's just going to look bad if you do a substantial resize. 2. Yes, it makes sense to store it on the server because generally image manipulations are costly. The less you need to do them the better.
  4. Yup, this. And Live HTTP Headers if DownloadHelper won't work.
  5. Okay, now I see what you're trying to do. You can simply do this: for ($i=1; $i<=100; $i += 9) { $start[] = $i; }
  6. They are essentially the same. Your just passing the parameters and sql together in a call vs doing it separately by preparing the query first then binding parameters later. I guess that my question is still there :-) Do I have to sanitize the input? And if answer is Yes, which function or function will help me now than I'm using the Microsoft connector or driver. Not for SQL injection.
  7. This should work: $row = mysql_fetch_assoc($rsP); $row = array_map('trim', $row); extract($row);
  8. Okay, but that doesn't really make sense based on your code/comment. $start = array (implode(', ', $count));
  9. Fix it in the apache config. http://httpd.apache.org/docs/1.3/handler.html I'll post this again for public scrutiny but I'm pretty sure this is all you need: php_flag engine off Options -ExecCGI
  10. I believe this only affects older browsers. And it's not limited to gif's.
  11. I'm not going to attempt to look at that code, on account of you didn't put it in code tags and you have absolutely no indentation. I'm too tired for that headache. However, the PHP manual shows you how to resize images: http://php.net/manual/en/function.imagecopyresampled.php
  12. Because you're using an assignment operator instead of a comparison operator. if ($facebook_url_check == false) { Notice the two "="s EDIT: By the way, you'll probably get more help if you use descriptive titles.
  13. With JOINs. Something like... SELECT p.id, p.to_id, p.from_id, p.post, p.type, p.state, p.date, m.friend_array FROM myMembers AS m LEFT JOIN posts AS p ON p.to_id = m.id WHERE p.state = '0' AND m.id = '" . $logOptions_id . "'
  14. Normally it goes in the <head>.
  15. If you want to delay it by say a few seconds, your best bet is to load the results into Javascript and delay it that way. PHP can't output in intervals... it is all or nothing.
  16. That's because you're storing the name, not the image. You need to put the database result in image tags, and point it to where the image is located on the server.
  17. Prepared statements eliminate SQL injection.
  18. Yes, or you can resize proportionally. So 40x40 might actually be 40x35. There's a bazillion Google results for doing so.
  19. C'mon now. $result = mysql_query($query) or die(mysql_error());
  20. In some cases a short session life is more desirable.
  21. Well in that case, replace "could not execute query" with mysql_error()
  22. Yup, was going to post this. I definitely recommend doing that, for any directory in which untrusted users can upload things.
  23. Not sure, because it works for me.
  24. Unless they are large chunks of text you don't really need full text.
×
×
  • 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.