Jump to content

2wasted

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

2wasted's Achievements

Member

Member (2/5)

0

Reputation

  1. [quote author=HuggieBear link=topic=110633.msg447653#msg447653 date=1160091253] OK, so like I said, do you want a current timestamp in the timestamp field? MySQL's [b]now()[/b] function will do that, see my code above. Huggie [/quote] cheers m8, works!!:-)
  2. [quote author=HuggieBear link=topic=110633.msg447650#msg447650 date=1160090791] You need to convert the time in php to a format MySQL can recognise... $date = time(); as suggested will not give you a valid date format in MySQL.  Do you just want a current timestamp, if so, use this: [code] <?php $query = "INSERT INTO onlineform (name, Cname, email, query, Pnumber, date) VALUES ('$name','$Cname','$email','$Query', '$Pnumber', now())"; ?> [/code] Regards Huggie [/quote] i think you have hit the nail on the head:-)it displays on the page but does not go in to the datamase(MYSQL)
  3. [quote author=mgallforever link=topic=110633.msg447643#msg447643 date=1160090496] [code] $query = "INSERT INTO onlineform (name,Cname,email,query,Pnumber,date) VALUES ('$name','$Cname','$email','$Query', '$Pnumber', '$date')"; [/code] try that [/quote] still the same m8
  4. [quote author=mgallforever link=topic=110633.msg447638#msg447638 date=1160090242] is id primary key w/ auto_increment? [/quote] yeah m8
  5. id int name vachar Cname varchar email varchar query varchar Pnumber varchar date timestamp
  6. i tryed copying mgallforever code and still the same problem:-(
  7. my inserts are the same order as my database m8
  8. this is what i have changed it to and it still does'nt work         $Name=$_POST['name']; $Cname=$_POST['cname']; $Query=$_POST['Question']; $email=$_POST['email']; $Pnumber=$_POST['Pnumber']; $date = time(); $query = "INSERT INTO onlineform VALUES ('','$name','$Cname','$email','$Query', '$Pnumber', '$showdate')"; mysql_query($query); mysql_close();   echo "<h2>THank you for filling in this form, we will be in touch with you ASAP</h2>";   //echo $showdate;
  9. i took out the echo $showdate; and it still never worked. i have tryed values of date&timestamp in the mysql database structure, could i use another? Charlie
  10. tryed that still 0000-00-00 00:00:00 thx Charlie
  11. the show date on the page works..it just does'nt go into the DB. thx Charlie
  12. lo all, i have a form that goes to a database, everthing works fine except the timestamp says 0000-00-00 00:00:00 .i have tryed changing the value in the mysql from timestamp to date but still is'nt working...i have displayed the date on my page np...here is the code ?PHP     $Name=$_POST['name']; $Cname=$_POST['cname']; $Query=$_POST['Question']; $email=$_POST['email']; $Pnumber=$_POST['Pnumber']; $date = time(); $showdate = date("H:i:s d/m/Y"); mysql_select_db($database_csc, $csc); $query_Recordset1 = "SELECT * FROM onlineform"; $Recordset1 = mysql_query($query_Recordset1, $csc) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); $query_Recordset1 or die( "Unable to select database"); if($_POST['submit']) { $query = "INSERT INTO onlineform VALUES ('','$name','$Cname','$email','$Query', '$Pnumber', '$date')"; mysql_query($query); mysql_close();   echo "<h2>THank you for filling in this form, we will be in touch with you ASAP</h2>";   echo $showdate; } ?> Thanks for any help Charlie
  13. here ya go:-)  <input name="submit" type="Submit" onclick="MM_validateForm('email','','RisEmail');return document.MM_returnValue" value="Enter information" />     </label></td>     <td>&nbsp;</td> <?PHP     $Name=$_POST['name']; $Cname=$_POST['cname']; $Query=$_POST['Question']; $email=$_POST['email']; mysql_select_db($database_csc, $csc); $query_Recordset1 = "SELECT * FROM onlineform"; $Recordset1 = mysql_query($query_Recordset1, $csc) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); $query_Recordset1 or die( "Unable to select database"); $query = "INSERT INTO onlineform VALUES ('','$name','$Cname','$email','$Query')"; mysql_query($query); mysql_close(); ?>
  14. lo all, i would like when my form is submitted it went 2 a thank you page, is this easy? thx Charlie
×
×
  • 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.