Jump to content

Why is the button in the dbs.php below not working after serializing an array ?


Recommended Posts

 <?php
$db=$_GET[db];
$query2="use $db";
$result2=mysql_query($query2);
$sql = "select * from $_GET[t]";
$result2 = mysql_query($sql);
$num=mysql_num_rows($result2);
$r=0;
$c=0;
echo "<script src='myareaajax.js'></script><form method='get' action='update.php'><table border=1><tr>";
for ($b=1; $b<=$num; $b++)
{
$sql2 = "select * from $_GET[t] where id='$b'";
$result4 = mysql_query($sql2);
while ($record = mysql_fetch_assoc($result4)) {
	while (list($fieldname, $fieldvalue) = each ($record)) {
            $c++;
		echo "<td><input type=text id=$c value=$fieldvalue /></td>";
		$arr[]="document.getElementbyId('".$c."').value;";
            
	}
	echo "</tr>";
	}
	$r++;
}
$arr=serialize($arr);
$table=$_GET["t"];
echo "</table>";
echo "<input type='hidden' name='c' value='$c'>";
  echo "<input type='hidden' name='r' value='$r'>";
  echo "<input type='hidden' name='t' value='$t'>";
  echo "<input type='hidden' name='db' value='$db'>";
  echo "<input type=button name=update value=Update   onclick=my_area('update.php','db=$db&t=$t&c=$c&r=$r&arr=$arr','3'); /></form><br />";
?>

 

before i could do this

<?php
$arr=serialize($arr);
?>

it worked fine, after it failed...

 

why ? pls help...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.