Cuba Posted May 5, 2009 Report Share Posted May 5, 2009 Sveiki! Jautājums ,iespējams, muļķīgs, bet tā kā esmu iesācējs, ceru uz palīdzību.. Tātad - veidojot aptauju nepieciešams, lai automātiski lietotāju atbildes tiktu saglabātas divdimensiju masīvā. Tad nu - kā, ar kādu funkciju to panākt? jau ipriekš paldies :) Quote Link to comment Share on other sites More sharing options...
marcis Posted May 5, 2009 Report Share Posted May 5, 2009 Kas ir divdimensiju masīvs? Quote Link to comment Share on other sites More sharing options...
Cuba Posted May 5, 2009 Author Report Share Posted May 5, 2009 (edited) Piemeers 2dimensiju masiivam: <?php $masiivs = array( array("vards", "atb1" , "atb2"), array("vards1", "atb1" , "atb2"), array("vards2", "atb1", "atb2") ); ?> bet kaa lai dabuu lai lietotaaja atbildes vinjaa tiek saglabaatas..? Edited May 5, 2009 by Cuba Quote Link to comment Share on other sites More sharing options...
v3rb0 Posted May 5, 2009 Report Share Posted May 5, 2009 $masiivs = array(); $masiivs[] = array('vards', 'atb1', 'atb2'); $masiivs[] = array('vards2', 'atb3', 'atb4'); ? Quote Link to comment Share on other sites More sharing options...
Cuba Posted May 5, 2009 Author Report Share Posted May 5, 2009 $masiivs = array(); $masiivs[] = array('vards', 'atb1', 'atb2'); $masiivs[] = array('vards2', 'atb3', 'atb4'); ? Bet kā insertot masīvā atbildes no html formas? Quote Link to comment Share on other sites More sharing options...
bubu Posted May 5, 2009 Report Share Posted May 5, 2009 $masiivs = array(); ... $masiivs[] = array($_POST["vards"], $_POST["atb3"], $_POST["atb4"]); Quote Link to comment Share on other sites More sharing options...
marcis Posted May 5, 2009 Report Share Posted May 5, 2009 Tik pat labi tu masīvu vari jau no html'a postēt. Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 5, 2009 Report Share Posted May 5, 2009 Vel varjants.. $masivs[0][0]=$_POST['aaa_1']; $masivs[0][1]=$_POST['bbb_1']; $masivs[1][0]=$_POST['aaa_2']; $masivs[1][1]=$_POST['bbb_2']; Quote Link to comment Share on other sites More sharing options...
Kaklz Posted May 5, 2009 Report Share Posted May 5, 2009 Labāk uzreiz padomā, ko tu tālāk darīsi ar tiem rezultātiem. Šeit ņem vērā arī faktu, ka tavs php masīvs, ja vien tu viņu nekur nesaglabāsi, pazudīs līdz ar mirkli, kad tava web lapa būs ielādējusies pārlūkprogrammā. Quote Link to comment Share on other sites More sharing options...
spoks Posted May 6, 2009 Report Share Posted May 6, 2009 serialize->saglabājam datu bāze un unserialize kad nepieciešams apskttīt kas tur īsti glabājās Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.