Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. XML is an excellent way to transfer information. For example an e-commerce site may get products, updates, etc. for their store to update. XML is an easy universal way to transfer this information. They just give you the format and you parse it to your preference. Another example is AJAX. Without refreshing the page you can get server side data and display it client side.
  2. Work in progress eh? Instead of all those escaping back slashes you can use single quotes. Anyway for this input field you would do:
  3. Can you post your form?
  4. Yes it has, and I'm sure you can find plenty of satisfying article/discussions/comparisons etc. over this. For example...
  5. 1) Concatenation. $final_date = "" . $_POST[dd] . "/" . $_POST[mm] . "/" . $_POST[yyyy] . ""; 2) Yes. You can do this using Javascript. onfocus="this.value = ( this.value == this.defaultValue ) ? '' : this.value;return true;">
  6. Is your friend's site being hosted on a different server? I think you have to configure mail.
  7. $query = "SELECT VotedFor, Count(UserID) FROM your_table GROUP BY VotedFor"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "User ". $row['COUNT(UserID)'] ." : Total Votes: ". $row['VotedFor'] ." "; } A userid with > 0 votes? : $query = "SELECT VotedFor, Count(UserID) FROM your_table GROUP BY VotedFor"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ if($row['COUNT(UserID)'] > 0) { echo "User ". $row['VotedFor'] ." : Total Votes: ". $row['COUNT(UserID)'] ." "; } }
  8. Yeah, I don't know why I posted my first solution, very inefficient. Barand's right... Should be: $result = mysql_query("SELECT * FROM artist WHERE lastname LIKE 'A%'");
  9. Yes JS is your best choice. I'd go with the basic progress bar.
  10. Just follow the tutorial and replace the image names with however you dynamically take them out of your database with PHP. Make sense? This is almost all JS just a bit of PHP to dynamically change the image names unless you want to hard code them in.....
  11. Then why did you ask?! J/k.
  12. echo "".$row['userlevel'].""; Here's something more readable.
  13. Why not use JS or flash? Do you have to use PHP or something?
  14. Have you fixed the LIKE clause? I can't test right now so I'm not sure if it will work.
  15. $query = "SELECT userlevel FROM user_levels ORDER BY userlevel_id"; For an optimized query you should really only SELECT the fields you need like above, not *.
  16. echo "";
  17. This is straight up a poor design in the first place. You would be much better off normalising your data. At least he lives up to his name... -You have a space in your variable... Did you mean $the_number? -You're doing the like wrong. LIKE '%$the_number%' ");
  18. It can't! What a weak language...
  19. Is this something you want someone else to do? Or you want to do with someone else? This really doesn't belong in the application design section. Cool idea though
  20. $sel_subject['visible'] doesn't even have a value to begin with. So in this piece of code: if ($sel_subject['visible'] == 0) { echo " checked"; } ?> /> No if ($sel_subject['visible'] == 1) { echo " checked"; } ?> /> Yes You're comparing nothing to 1 and 0.
  21. if(strtoupper(substr($last_name, 0, 1)) == 'A') { //found a match } else { //do something else } "Aa" does start with A...
  22. Is this what you mean... include("lib.php"); $player = check_user($secret_key, $db); if($player->money city_id == 2) { header("location: home.php"); } else { $query = $db->execute("update `players` set `money`=?, `city_id`=2 where `id`=?", array($player->money - 1000, $player->id )); } ?>
  23. while($var1 > 0 && $var2 > 0) {
  24. Arrays, where?
  25. Ok, that's your choice... It's always good to cleanse the value anyway because if you decide to change the way that it is inputted or copy this code for something else, etc... you may have a problem. Anyway, your problem lays here; The single quotes from the post get confused with the single quotes surrounding the actual value. You don't even need those single quotes because you're comparing integers. A good way to debug this situation is echo out $sql2 to see the actual query statement that is taking place.
×
×
  • 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.