Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. First, let PHP create the table for you in the while loop after you extract your data. Something like? SELECT * FROM question ORDER BY [date or id] DESC LIMIT 10 Not sure exactly what you mean. Maybe Pagination?
  2. There's no need for all those switch statements. Use something like this: </pre> <form method="POST" action="<?php%20echo%20%24_SERVER%5B'PHP_SELF'%5D;%20?>"> 2009 2008 2007 2006 All Years Last Name Test Date </form> <br><br>if(isset($_POST['submit'])) <br>{<br> // declare vars & describe method of populating vars<br> $datex = $_POST['datex']; //range of dates<br> $sortx = $_POST['sortx']; //sort by <br> $query = "SELECT * FROM passed";<br> $query .= ($datex=='0') ? "" : " WHERE year(testdate) = $datex"; <br> $query .= (isset($sortx)) ? " ORDER BY $sortx" : "";<br> echo $query;<br>}<br
  3. You have to concatenate it to the string by breaking out of the string. echo "Language2"; I believe you can just use curly braces to escape the single quotes in the array as well: echo "Language2";
  4. I think you're looking for: ?lang=2'>Language1
  5. Huh?
  6. Huh? Don't you mean: "There are some things you can figure out, for everything else, there's Google". Yes, I certainly did, Ken. I copied the original quote which uses, "can't" and forgot to change it.
  7. "There are some things you can't figure out, for everything else, there's Google". Nice! I never seen that before Great slogan. You were the inspiration
  8. "There are some things you can't figure out, for everything else, there's Google".
  9. Who's judging? We're just trying to help and for some reason you're taking it the wrong way. All they said was if you call a MySQL DELETE, it will delete, NEVER insert, update, select etc... which is 100% true. Anyway, glad to see it's finally resolved.
  10. Sure, in fact it's better to have some kind of server-side validation due to the fact that users can disable JS. You can use something like: $d = "u12324"; if(preg_match("/^[a-z]\d{4}$/i", $d)) { echo "success"; } else { echo "fail"; } ?>
  11. Please use Google first: Multiple SELECT.
  12. Maq

    "IF" commands...

    Apparently Google doesn't like everybody...
  13. Post what you have tried.
  14. I always use FF and it never really lags for me. Although, this morning phpfreaks was just hanging for about an hour, hour and a half. EDIT: I'm using Ubuntu as well.
  15. Let MySQL handle that for you. You can order the ids by descending and limit them by 30. Something like: $sql = "SELECT id, date, title FROM Newsposting ORDER BY id DESC LIMIT 30"; $queryresult = mysqli_query($db, $sql); while($rowresult = mysqli_fetch_array($queryresult, MYSQLI_ASSOC)) { $id = $rowresult['id']; echo ''.$rowresult['date'].' '.$rowresult['title'].''; echo " "; }
  16. Guess we won't know until he elaborates on his application first.
  17. Try this, should be pretty self explanatory, but if you have questions please ask: </pre> <form method="GET" action="file.php?action=1234"> </form> <br><br><br>if($_GET['$action'] == 1234)<br>{<br> print"hi";<br>}<br
  18. You would have to change the CSS to align left, or change the margin-left to negative spacing.
  19. What's the error...?
  20. Yeah sorry... Ken posted the correct code.
  21. Like Ken mentioned earlier, empty refers to all of these conditions, so you only need to check for empty. You should trim first as well. if (empty(trim($unit))) { Here's the scenarios when empty returns true:
  22. Not sure what exactly you mean by: push data from a form into a .xls of sql file. Do you mean and excel sheet that was populated with database records? There are libraries to handle excel sheets.
  23. Great, you mind sharing the final solution for others with the same problem. You should also mark this solved.
  24. You mind posting the final solution, so others can easily refer to it?
×
×
  • 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.