Jump to content

dabaR

Members
  • Posts

    189
  • Joined

  • Last visited

Everything posted by dabaR

  1. preg_match([0-9]{7,10}$field2) can't work, because it is syntactically incorrect. You can try preg_match('/^[0-9]{7,10}$/', $field2)
  2. die() simply prints strings... false is the empty string, there you have automatic type conversion. If you are still asking what is the problem with the code, it is still the same, unless you changed that... You do not keep information about the fact the person logged in across requests. So the person logs in on a post, on the next get the $session is created anew, without it being logged in. In other words, your "Session" is not doing the thing that is the essence of being a Session. Consider that, and try to figure out how you are going to deal with it. Usually people use $_SESSION to hold an identifier and check whether the person requesting the page is logged in already. That's really pretty much your only option. </incoherentMorningTalk>
  3. Is there still a problem you are looking for advice with? I ask because you did not ask a question in your last post.
  4. Show the code that produces the error?
  5. Try: SELECT songlist.artist, SUM(songlist.count_played) AS count_played FROM radio.songlist GROUP BY songlist.artist ORDER BY SUM(songlist.count_played) DESC LIMIT 10
  6. The problem is not very likely in the SQL you've shown, but rather in the environment it lives in.
  7. Try: SELECT songlist.artist, SUM(songlist.count_played) FROM radio.songlist GROUP BY songlist.artist ORDER BY SUM(songlist.count_played) DESC LIMIT 10
  8. SELECT player, SUM(goals) FROM match_stats WHERE player = 'dabaR'; Maybe you can modify that to your situation.
  9. Are we adding the features to phpwares.com?
  10. Hi again, echo "". $row['image_location'] . ""; seems unnecessarily chatty. Seems like echo $row['image_location']; would do the same. I would rewrite echo "<img src=".$row['image_location']." height=100 width=100 border=0>"; as printf('<img src="%s" height="100" width="100" style="border: 0" />', $row['image_location']); Because I think that is more solid HTML.
  11. Yes, it is as straightforward as that.
  12. I take it you are working on linux? What is the name of the web server user? You can do ps aux to find out.
  13. There should not be a space between <? and php
  14. http://www.tizag.com/phpT/fileupload.php
  15. Hi, The problem is that $session is created anew every time a page is loaded, and the fact that you actually logged in on last load is ignored.
  16. Hi there. I don't see that process.php is actually part of the program. Can you point to the place where it is included?
  17. Should be while() { ... } not while () ( ... )
  18. So how about something like SELECT TOP 1 * FROM table WHERE (for - against) > $voting_score OR ((for-against) = $voting_score and id > $current_id) ORDER BY (for - against) ASC, id ASC Sorry about it being so pseudocody instead of specific. You'll have to translate to your exact code. That code is meant to have all interpolations of variables into the SQL string escaped using something like mysql_real_escape_string() as well.
  19. Oh, and.... Get into the habit of starting all your scripts with error_reporting(E_ALL);
  20. There are no quotes around the query string. You need: $query = 'INSERT INTO Users(user, date_registered, password, email) VALUES ("eric", "12/12/12, test, eric@eric.com")';
  21. What about the program that you are using that you see the squares? PHPMyAdmin? PHP? Command-line mysql? Something else?
  22. Well, what, if a post has 5 up and 3 down, then the next post is on that has 5 up and 2 down, and previous is one that has 4 up and 3 down? What if the posts have the same number of up and down votes?
  23. What constitutes the next/previous content? Is it by date? Amount of votes?
×
×
  • 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.