array issues

From: Date: Thu, 09 Aug 2001 21:00:22 +0000
Subject: array issues
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-62045@lists.php.net to get a copy of this message
I believe that there is a better way to do what I am trying to do here. I have an online form to enter interviews into a MySQL db right now it is like this <input type="text" name="q1" size="100"> <input type="text" name="a1" size="100"> <input type="text" name="q2" size="100"> <input type="text" name="a2" size="100"> etc... each going to their own spot in the table. with this $query = "insert into interviews(id,interviewed,interviewer,q1,a1,q2,a2,q3,a3,q4,a4,q5,a5,q6,a6,q7 ,a7,q8,a8,q9,a9,q10,a10,interview_date) values('','$interviewed','interviewer','$q1','$a1','$q2','$a2','$q3','$a3',' $q4','$a4','$q5','$a5','$q6','$a6','$q7','$a7','$q8','$a8','$q9','$a9','$q10 ','$a10',NOW())"; I think it would be easier if I could put them into arrays like this <input type="text" name="q[]" size="100"> I'm just not sure how to go about the insert statement then the retrieval and formatting for the web. any thoughts or advise is appreciated. Jerry Lake Interface Engineering Technician

« previous php.general (#62045) next »