Jump to content

Archived

This topic is now archived and is closed to further replies.

Unholy Prayer

User Date Selection

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Just add the variables together and then insert that value...

[code]

<?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());

[/code]

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

HTH

Share this post


Link to post
Share on other sites

×

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.