Jump to content

peeaitchpee

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by peeaitchpee

  1. wow. only took a few seconds to embarass me. That's the one thing I didnt bother trying. Thanks!
  2. I'm having an issue grabbing the value of a variable, it's asyntax issue and i'm drawing a blank $which = "nav_order"; // nav_order is the column name in a mysql db $sql = "SELECT `id`, `$which` FROM `nav` WHERE `$which` <= '$order' ORDER BY `$which` DESC LIMIT 0, 2"; $result = mysql_query($sql, $connection) or die ("Couldn't execute query."); $row = mysql_fetch_array($result); // this works fine $this_order = $row['$which']; This is the issue. I cannot get the value of the 'nav_order' column. I thought it was $this_order = $row['{$}which'];, but this is not working, nor is $this_order = $row['$$which']; Thanks in advance
  3. ok..so feel free to rip me... how would you syntax this?: $sql = "SELECT `id`, `link`, `topic`, `copy` FROM `newsletter_copy` WHERE `newsletter` = '$_POST[newsletter]' ORDER BY `order` ASC"; this does work...but if I'm reading right...I'm been doing it wrong forever
  4. I hate forums sometime...never can get the person's tone of voice as far as the code i'm running, I posted it all - that's as far as I got on that file there is a form on another file which has event name, location and date fields and I'm working on validating the post results. $d = "blahuasldfjlasjfd"; if (strtotime($d) == FALSE){ // no good, enter it again echo "no good"; } else { // we're good, do something echo "good"; } is what you had. so changed the $d to $date. and declared $date = $_POST[date] as opposed to "blahuasldfjlasjfd" Maybe I fail to see the difference. Regardless I did get it working, so thank you. This leads me to another question... $_POST["date"], $_POST['date'] and $_POST[date] are not the same, are they? I was always under the impression that it was just a preference in syntax. That's not the case is it? What is the difference and/or where should I look it up in the docs? Thanks again
  5. wow..guy goes to lunch and finds all these replies. Thanks all. to phil: i actually did do that, and the strange this is that it is passing over the $_POST['date'] as needed., hence why I was stumped. I also did the strict === and the result was the same to Maq: that's why I put in the p.s. in my first post...am using 5.2. That said, when I modify my original if (strtotime($_POST[date]) == FALSE){ // no good, enter it again } else { // we're good, do something } to $date = $_POST[date]; if (strtotime($date == FALSE){ // no good, enter it again } else { // we're good, do something } using your method it works. That must mean there is something amiss in the php settings, since it should not make any differnce. Unless I'm completely nuts...
  6. I'm wanting to use strtotime to validate a date in a form, however it will not find it FALSE, ever. Everything passes. Here is what I am using: if (strtotime($_POST[date]) == FALSE){ // no good, enter it again } else { // we're good, do something } any suggestion? Thanks in advance p.s. I'm using php 5.2
×
×
  • 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.