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
Insert Failing.
Hey,I am making a Sign up page for a website, but the insert query into the Database does not seem to work, it returns no errors, just simply does not work.Code: $insert_user =
what business processes?
Hi,
array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in...." error on the following site: http://nwsurfing.com/buoy.phpi
very easy question about SQL info
Hello,I think that I have a very easy question.I know how to create a form using php SQL and display the info.BUT the only problem that I have is:In my website, I am linking all the pages with the
Navigation include for all site directories
Hi,I need a navigation include that can deal with directories at different levels on a site. All I can seem to find are the basic includes for files all in the same directory. This doesn't work for me
delete comma
HI,How to delete "," at the end of the string.Code: $match = 2009/02/03/a2correx03cvbnm,echo preg_replace("/;$/", "HI", "$match");
Php - mysql store data and use it later?
Hi, i' making a login page at the moment, however my username + password is stored many different places, and is kinda hard to get, so I have written this entire code:Code:
default SAP userid
hi,, I just like to know if it is ok to use the default SAP user id (SAP*)?
Filename and Line Number Custom Error
I have a class, with a method that accepts 2 parameters. I would like to output error messages. So, lets say a new file is created, and my class is used in that file. We will call that file test.php
Scheduler problems related to execution of a single BLT by many schedules
Hello all,