Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP with DATE_ADD did not work
    primarykey
    data
    text
    <p>Thanks to everybody who gave me some advice and answers. As I'm so new to this, I must appologize for some poor questions and technical terms. I decided to use DREAMWEAVER to finish this and still have some problems. These are the changes that I made:</p> <p>1.Change 'expiry_date' field to NULL because when I submit the form with 'NOT NULL' it didn't get through (<code>expiry_date</code> DATE NULL ,).</p> <p>2.This is the code that I have</p> <pre><code>if ((isset($_POST["MM_insert"])) &amp;&amp; ($_POST["MM_insert"] == "form1")) { $template = "INSERT INTO expirydate_table " . "(firstname, lastname, email, password, " . "signup_date, expiry_date) " . "VALUES (%s, %s, %s, %s, %s, %s)"; $insertSQL = sprintf( $template, GetSQLValueString($_POST['firstname'], "text"), GetSQLValueString($_POST['lastname'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['password'], "text"), GetSQLValueString($_POST['signup_date'], "date"), GetSQLValueString($_POST['expiry_date'], "date") ); </code></pre> <p>3.The form with the hidden fileds of 'signup_date' and 'expiry_date'</p> <pre><code>&lt;input type="hidden" name="signup_date" value="&lt;?php echo $row_RecRegister3['NOW()']; ?&gt;"&gt; &lt;input type="hidden" name="expiry_date" value="&lt;?php echo $row_RecRegister3['DATE_ADD(NOW() , INTERVAL 30 DAY))']; ?&gt;"&gt; &lt;input type="hidden" name="MM_insert" value="form1"&gt; </code></pre> <p></p> <p>Result:</p> <ol> <li>I can submit the form and <code>signup_date</code> displays in database.</li> <li><code>expiry_date</code> did not show any data.</li> </ol> <p>Question:</p> <ol> <li>Is there any function to make it work or replace 'DATE_ADD(NOW(), INTERVAL 30 DAY)'?</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload