Jump to content

phppup

Members
  • Posts

    711
  • Joined

  • Last visited

Posts posted by phppup

  1. Never used AJAX (except in the sink!)

     

    It's not THAT important, was just thinking out loud.

     

    There's probably something burried in my Javascripting that'd do it too, but I'm trying to learn/experiment with PHP and database usage.

  2. OK, so I thought it was as simple as just slapping it in there and having it echo the time on my page.

     

    So I tried:

    date_default_timezone_set('America/New_York');

    $date = date('Y-m-d H:m');

    echo "It is now $date";

     

    and got the same error as above: Fatal error: Call to undefined function: date_default_timezone_set()

     

    but when I took out the top line: date_default_timezone_set('America/New_York');

    I got a time posting, but it is Californian.

     

    I suppose there are two different things I have in mind.  Fist, just to have the time display as an ECHO message.

    Second, if I can get it to run, I would add it to my table so I could get the NYtime that a record was added.

     

  3. Does time zone change have to occur in an INI file, or can I place it as a value.

     

    I've tried using default_time_zone ('America/New York') but had no success with it, even to just ECHO a statement that says: It is now 3:50PM in New York.

  4. Along the same lines as a "Thank you for you submission" message, is there a simple way to echo the CHANGES made to a record AFTER it has been UPDATED.

     

    For example: You have added 2 skirts and 1 shirt to your order

    OR      You're order has been reduced by 2 pair of socks.

     

    This would compare what was stored with the change.

     

    Alternately, is there a way to show a message that ONLY addresses the values that have CHANGED as a result of the UPDATE.

    Example:  You have altered the quantity of the following items: dresses, hats, gloves.

     

  5. WOW!  found the same line of code in my UPDATE script.  Took it out and I'm working fine now.

     

    Thanks a TON! 

     

    (i think i'll quit while ahead... LOL)

     

    So what EXACTLY is that line saying?

     

    And is it necessary in one way or another as a double-check process of the form?

  6. It worked prviously with it (i think!), but i took it out and it seems to have repaired the problem.

     

    So what EXACTLY is that line saying?

     

    And is it necessary in one way or another as a double-check process of the form?

  7. CONNECT

    if(isset($_POST['action']) && $_POST['action'] == 'submitform')

    {

    $roastturkey = $_POST['roastturkey'];

    $broccoli = $_POST['broccoli'];

    $brisket = $_POST['brisket'];

    $carrots = $_POST['carrots'];

    }

     

    $sql = "INSERT INTO pass (roastturkey,broccoli,brisket,carrots) VALUES ('$roastturkey','$broccoli','$brisket','$carrots')";

     

    $result=mysql_query($sql);

     

    if($result){

    echo "Successful";

    }else {

    echo "ERROR";

    }

     

    Fairly simple, I think, and it used to work.

     

    ** Disclaimer: Not responsible if this code causes hunger or urges to snack **

  8. I will start posting code if I have to, but first, the only "adjustment" made to the actual database was that I may have added to columns (at various locations between others) and then I later deleted them. 

    I have since replaced them as a troubleshooting technique, but their NAMES are NOT receiving any values (which is why I removed them in the first place).

     

    Does this sort of manuever affect the tables?? 

     

    (I'm a newbie, so maybe I just messed it up... LOL)

  9. My database was working fine (for test purposes) a week ago.  Now, it will not record data input from my forms.

    If I add a new record, it adds the record, but none of the data.

    If I update a record, it erases the values.

     

    The forms and attached scripts have NOT undergone any changes, and they DO provide SUCCESS messages.

     

    Ideas?

  10. I may be on my way to a solution.

    Question: If the code below will scan ALL fields of my form, how can I add to the code to eliminate just one or two of the inputs, while leaving the remaining 30?

     

    $myUpdateList = array();foreach($_POST as $indexName => $value) {    $myUpdateList[] = "$indexName = \"$value

×
×
  • 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.