Jump to content

Miss_Rebelx

Members
  • Posts

    71
  • Joined

  • Last visited

    Never

Everything posted by Miss_Rebelx

  1. Ahh. Then yes your suggestion of total divided by two. You may want to incorporate the modulus for the cases where it's an odd total: http://php.net/manual/en/internals2.opcodes.mod.php
  2. Try an ORDER BY desc (then add the LIMIT again).
  3. What error message are you getting? What results are you expecting that you are NOT achieving? What's going wrong?
  4. Do you have the field set to auto increment, or some other sequence/trigger, or are you manually setting the value?
  5. I'm not sure that you can do a post action to an included page. You could, however, include the results page in the process page (that being the only include). Therefore, you go to the quiz page, it directs you to the process page upon posting results, and it includes (or rather, it displays) the results page.
  6. Pick up a PHP book, read it and do the exercises at the end of the chapters. That way you get practice, solutions, learn, there won't be designing to do, and you won't have to spend extreme amounts of time developing code you won't use again.
  7. Can you post a screenshot of what it does exactly?
  8. Not sure I'm following. "put these key/value pairs into variables in my "action" page, for example..."
  9. Correct. For example you can do this: $variable = "A hidden value";//Then you make your form here...echo "<input type='hidden' name='something' value='$variable'>";// Rest of your form and submit button So then on the next page you could do... $variable = $_POST['something'];echo $variable;//This would echo out "A hidden value"
  10. What else would you want it to contain? It can contain values of any variables from the first page through hidden fields for example.
  11. It would be in the page that receives the information from your form, so the page the form submits to. The page where your form is wouldn't have any of the posted data, unless it was also posted to from another page.
  12. This sticky thread should be of use to you: http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
  13. Maybe just incorporate an if empty statement: http://php.net/manual/en/function.empty.php if (!empty ($var)) { // continue }
  14. I think I messed up when I said to use " += ". I think a string concatenation is " .= ". Can you try switching that in at the 3 places in the code? Also, switch blank() with empty().... I'm about to leave work so please accept my apologies for this.
  15. You're missing a double quote: $sql = INSERT INTO jobs VALUES Should be: $sql = "INSERT INTO jobs VALUES
  16. SELECT SUM(items.price) FROM items INNER JOIN order_items ON items.item_id = order_items.item_id INNER JOIN orders ON order_items.order_id = orders.order_id WHERE orders.date = (DATE) Not sure if you're going to manually type in the date, or use PHP (for example) to pass it a variable containing the date you want, but unless I messed up on the INNER JOIN (UGH! I hate them!) this query should work for you.
  17. $sql = mysql_query("INSERT INTO members VALUES ( NULL, '$yr', '$init', '{$_POST['y']}-{$_POST['m']}-{$_POST['d']}', '{$_POST['contact']}' //...
  18. Changed an error (has misnamed $memberLinks at some point), fixed your mysql logic at the top (you should read up on it though, and yes the other page was better and useful read to you), and added a check in case you have no members of certain statuses. <?php include "config.php"; $sql = "SELECT id, username FROM gusers"; $result = mysql_query($sql) or die (mysql_error()); $rows = mysql_num_rows($result); if ($rows > 0) { $adminLinks = ""; $honoredLinks = ""; $memberLinks = ""; while ($row = mysql_fetch_assoc($result)) { switch ($row['status']) { case '1': $memberLinks += "<a href='profile.php?id={$row['id']}'>{$row['username']} \n<br/></a>"; break; case '2' or '3': $honoredLinks += "<a href='profile.php?id={$row['id']}'>{$row['username']} \n<br/></a>"; break; case '4': $adminLinks += "<a href='profile.php?id={$row['id']}'>{$row['username']} \n<br/></a>"; break; } } if (blank($adminLinks)) { $adminLinks = "There are no administrators."; } if (blank($honoredLinks)) { $adminLinks = "There are no honored members."; } if (blank($memberLinks)) { $adminLinks = "There are no members."; } echo $adminLinks . "<br>" . $honoredLinks . "<br>" . $memberLinks; } }
  19. Agreeing to what Pikachu2000 said. But beyond that, what is $ReportType returning? (What kind of value?) Maybe we can help you find a way to do the sort you want.
  20. http://www.phpfreaks.com/forums/index.php/topic,310819.msg1467918.html#msg1467918 Your getting one zero? That's it? A blank screen, with a zero? No error messages?
  21. Yes but you didn't put in curly braces as Pikachu2000 suggested. Go through the code and do that - because right now your code keeps breaking at every single quote you use. Think of your quotes as levels. If you are in level 1 ("s) and use a single quote (') then you are in level 2. If you use another single quote, you break back into level 1. (If that makes any sense to you) So in the code you provided, you basically kept changing levels at the wrong places when in fact you wanted to go to a third level, of sorts, by using the curly braces.
  22. Yeah I guess I could have put it through notepad++ and checked it out first As far as the assignment part goes: I'm not going to bother fixing that since he asked about it in another thread, I gave him a clean way to do it, and he ignored the answer. So, then I won't bother to fix it (again) here x.x" OP: Did you fix the brace error?
  23. Feel like using google.com every once in a while? A quick search will generate many results. Or even better, this site has tutorials: http://www.phpfreaks.com/search?q=Login
  24. What's it doing? What error message? What should it be doing?
  25. Two questions (for which I'm not sure of the answers without testing / researching more: 1) Can you use an associative array without quotes for the index? //Is this valid? $_POST[initial]; //Or must it be like this: $_POST['initial']; //Or even like this: $_POST["initial"]; 2) I don't think that you did this line properly: '$_POST[y]-$_POST[m]-$_POST[d]',date Remove the "date" part.
×
×
  • 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.