jd2007 Posted August 9, 2007 Share Posted August 9, 2007 <?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... Link to comment https://forums.phpfreaks.com/topic/64016-why-is-the-button-in-the-dbsphp-below-not-working-after-serializing-an-array/ Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 try to print the array that your trying to serialize Link to comment https://forums.phpfreaks.com/topic/64016-why-is-the-button-in-the-dbsphp-below-not-working-after-serializing-an-array/#findComment-319108 Share on other sites More sharing options...
jd2007 Posted August 9, 2007 Author Share Posted August 9, 2007 before serializing, i get: Array after serializing, i get: a:2:{i:0;s:35:"document.getElementbyId('1').value;";i:1;s:35:"document.getElementbyId('2').value;";} Link to comment https://forums.phpfreaks.com/topic/64016-why-is-the-button-in-the-dbsphp-below-not-working-after-serializing-an-array/#findComment-319115 Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 what do you expect heres how you put value $arr[]="document.getElementbyId('".$c."').value;"; LOL it not going to work like you want a js to get the damn value LOL Link to comment https://forums.phpfreaks.com/topic/64016-why-is-the-button-in-the-dbsphp-below-not-working-after-serializing-an-array/#findComment-319121 Share on other sites More sharing options...
jd2007 Posted August 9, 2007 Author Share Posted August 9, 2007 oh, yeah lol...i forgot that...sorry Link to comment https://forums.phpfreaks.com/topic/64016-why-is-the-button-in-the-dbsphp-below-not-working-after-serializing-an-array/#findComment-319132 Share on other sites More sharing options...
jd2007 Posted August 9, 2007 Author Share Posted August 9, 2007 hi , i replaced $arr[]="document.getElementbyId('$c').value;"; with $arr[]="<script> document.getElementbyId('$c').value; </script>"; but the button still doesn't work...why ? Link to comment https://forums.phpfreaks.com/topic/64016-why-is-the-button-in-the-dbsphp-below-not-working-after-serializing-an-array/#findComment-319174 Share on other sites More sharing options...
jd2007 Posted August 9, 2007 Author Share Posted August 9, 2007 pls help me , how to send an array via a form to a php script ? Link to comment https://forums.phpfreaks.com/topic/64016-why-is-the-button-in-the-dbsphp-below-not-working-after-serializing-an-array/#findComment-319215 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.