Jump to content


Photo

User Date Selection


  • Please log in to reply
1 reply to this topic

#1 Unholy Prayer

Unholy Prayer
  • Members
  • PipPipPip
  • Advanced Member
  • 166 posts

Posted 22 October 2006 - 08:20 PM

Ok, I am making a php script where a user can add a scheduled clan match and select the date that it takes place on.  How do I insert values from multiple dropdown menus into one database column?



#2 gmwebs

gmwebs
  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 22 October 2006 - 08:39 PM

Just add the variables together and then insert that value...


<?php

//get the values POSTed from the form

$day = $_POST['day'];
$month = $_POST['month'];
$year = $_POST['year'];

$fulldate = $day . "/" . $month . "/" . $year; // will equal dd/mm/yyyy depending on what you have in your form

$sql = "INSERT INTO tablename (date) VALUES('$fulldate')";

mysql_query($sql) or die (mysql_error());


Or something like that but you should get the idea...

HTH




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users