hi all ,
I got a form with 6 fields (2 input and 4 select box), when the page loads one block is shown and through javascript all the fields can be copied multiple times so I need to store the data in array (got hint from here -> http://www.evolt.org/node/60222 ), I manage to save the data but while displaying i get lot of errors
Notice: unserialize() [function.unserialize]: Error at offset 0 of 1 bytes in C:wampwwwartustestme.php on line 67
Notice: unserialize() [function.unserialize]: Error at offset 9 of 10 bytes in C:wampwwwartustestme.php on line 67
this is my php code
Code: <?php
////////////////////////////function defination///////////////////////
function showMonth()
{
$arr=array("January","February","March","April","May","June","July","August","September","October","November","December");
for($i=0;$i<count($arr);$i++)
{
echo "<option value='".$arr[$i]."'>".$arr[$i]."</option>";
}
}
function showYear()
{
$d=getdate();
$curYear=$d['year'];
for($i=$curYear;$i>($curYear-50);$i--)
{
echo "<option value='".$i."'>".$i."</option>";
}
}
// connect to database
define("HOST","localhost");
define("USER","root");
define("PASS","");
define("DATABASE","artuscom");
$con = mysql_connect(HOST,USER,PASS);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db(DATABASE, $con);
// ends here
// start post
if (isset($_POST['submit']))
{
$org = serialize($_POST['curEmpName']);
$des = serialize($_POST['curEmpDesignation']);
$start_month = serialize($_POST['curEmpStartMonth']);
$start_year = serialize($_POST['curEmpStartYear']);
$end_month = serialize($_POST['curEmpEndMonth']);
$end_year = serialize($_POST['curEmpEndYear']);
$query="Insert into artus_test values('','$org','$des','$start_month','$start_year','$end_month','$end_year')";
$result=mysql_query($query);
if ($result) {
echo 'success';
} else { echo 'something failed...';}
}
// show records
if (isset($_POST['showrecord']))
{
$query='SELECT * FROM artus_test';
$result=mysql_query($query);
while($row = mysql_fetch_assoc($result)){
echo "ID: ".unserialize($row['test_id']).", Organization:".unserialize($row['organ']).", Designation:".unserialize($row['design']).", Start-month:".unserialize($row['start_month']).", Start-year:".unserialize($row['start_year']).", End-month:".unserialize($row['end_month']).", End-year:".unserialize($row['end_year'])."<br/>";
}
}
?>
can anyone help please
how to populate a drop down box
Hi buddies!
need help with this contact form
I made this form and I need it to read the data and write the data to a table and its not working can someone please help me and show me what I have wrong so I can fix it heres the html form I left
Batch Related Pricing
Hi, I need some clarity on the batch related pricing
Database/Table Collation
What is the Database, and table collations used for? i don't understand what there used for since columns have there already set collation....
if php cookie set, show code...
Hi all.. I need to figure out this little snippet right quick.. seems like it should be easy enough to do, but I'm flailing here...I need to have a blurb that checks to see if a cookie of a specific
column name cancatenation within PL/SQL
I have a PLSQL store procedure, and the following statement is part of a subquery
pagination - need help on passing of search query.
Hi, i have been trying for days but couldn't get this sorted out. Would like some professional help here. Basically I got a basic pagination script from google search and the script works absolutely
Comment Mod System Effects all rows...
Sorry if its confusing but here is whats going on: I have a table in a database called comments and there are alot of entries there but can manually be marked flagged with a 1. nevermind how that is
php wont update my db
hello,sorry for posting in mysql forum but i dont know where exactly is the problem but here is the linkhttp://www.phpfreaks.com/forums/index.php/topic,272737.0.htm
Guixt issue
Hello all,