Ok I am working on another form that has three different options to be entered into my DB. Everything is getting entered and it's working. Problem is they are being entered onto seprate lines instead of one line. The form I am working on can be seen here
http://www.texascaching.com/date_placed.html
I think, no, I know I did something wrong for it to be entered this way, just not sure what.
<?
include("dbinfo.inc.php");
$str_date_placed_month = $_POST['date_placed_month'];
$str_date_placed_month = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_date_placed_month);
$str_date_placed_day = $_POST['date_placed_day'];
$str_date_placed_day = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_date_placed_day);
$str_date_placed_year = $_POST['date_placed_year'];
$str_date_placed_year = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_date_placed_year);
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = mysql_query("INSERT INTO date_placed (date_placed_month) VALUES ('$str_date_placed_month')")or die (mysql_error());
$query = mysql_query("INSERT INTO date_placed (date_placed_day) VALUES ('$str_date_placed_day')")or die (mysql_error());
$query = mysql_query("INSERT INTO date_placed (date_placed_year) VALUES ('$str_date_placed_year')")or die (mysql_error());
{
echo "Thanks for your help while we continue to develop. Click the Home button in the upper left corner to return back to the Home Page.";
}
mysql_close();
?>
Now like I said everything is working just the options from the table are being entered on different lines which means it takes on 3 lines for one date instead of just using 1 line.
The table has 4 feilds, ID, date_placed_month, date_placed_day, date_placed_year. Like I said everything is being entered correctly except the fact it is not being entered on 1 line and I am sure it has to do with how I have the script wrote. Could it be that I am calling the $query = mysql_query( 3 seperate times for each feild? Thanks in advance for any help.
-Thanks