If you really, really want to save it in a single row, do so by:
$accnumfield = "'" . implode('|', $accnum) . "'";
Then to retrieve them and split them up back into an array:
$accnum = explode('|', $row['accnum']);
However I would strongly recommend against storing it in one row. Doing that is like banging a nail into wood with a piece of glass - it’s possible but you’re going to make a lot of mess doing so, and chances are somethings going to break at some point.
It would make so much more sense to have a different table for each of those arrays, all with a common foreign-ID linking to some base table. That way things would be linkable, so much more consistent and you can make much more sense of the data. Search queries would be faster. By throwing it all into one box you also lose all ability to calculate any statistics, and maintenance is likely to be hell.
Jake - claro’s wording wasn’t the best but he is basically trying to post a table of account records. So if you slice straight across the arrays then you end up with one record. Of course he will have to make some adjustments once he starts using check boxes and he will have to change a few things in order to modify the records but he is on the right track.
thank you for your responses, you’re right sir ahundiak, my variables are in a different fields. I have two pages, A.php and B.php, the first page is compose of the book details [authors(array), subject, etc.], and when the user click the next button he will directed to my B.php which compose of the acquisition details[acc.no (array), price, date recieved, supplier, etc. ]
Now I’m having trouble in saving it, since both pages have arrays, and it bothers me also if I’ll save A.php right after the user hit the next button or I’ll just save it together with B.php at the same time (in different tables).
Ok you got me. I found a solution on my past problem and now I’m continuing. (I just don’t know how to declare that post is already been solved and shame to tell that the problem is in my js which I told that the is not problem my js part, there’s an issue of naming my textbox)
And I am here now.
Did you understand the gist of my post #2 on how to pull individual records from multiple arrays?
But, I still have to save the book detail, I separated the tbl_bdetail and tbl_author, that in my tbl_bdetail I want to save all the authors and in my tbl_author I want to save the books detail written by a common author.