Timeline for How to store each element as source and destination from array in php?
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Feb 22, 2022 at 16:11 | vote | accept | amit sutar | ||
S Feb 22, 2022 at 16:11 | vote | accept | amit sutar | ||
S Feb 22, 2022 at 16:11 | |||||
Feb 22, 2022 at 16:11 | vote | accept | amit sutar | ||
S Feb 22, 2022 at 16:11 | |||||
Feb 22, 2022 at 15:44 | answer | added | RiggsFolly | timeline score: 0 | |
Feb 22, 2022 at 15:21 | answer | added | Angel Deykov | timeline score: 0 | |
Feb 22, 2022 at 15:18 | comment | added | amit sutar | $array = ['1','2','3','4']; $firstEle = reset($array); // to get first element foreach($array as $val){ if($val != $firstEle){ $sql = "insert into table_name (source,destination) values ($firstEle, $val)"; } //able to enter for first element . } // by this i am able to store data for first element only. after that i am stuck, @CBroe | |
Feb 22, 2022 at 14:54 | comment | added | RiggsFolly | try a FOR loop inside a FOR loop | |
Feb 22, 2022 at 14:52 | comment | added | RiggsFolly | There is nothing wrong with asking for a bit of help with your homework. Beginners are welcome, but we expect a good faith attempt at an answer from you first. SO is not a free coding service although we are very willing to help you fix issues with code you have written. How do I ask and answer homework questions? | |
Feb 22, 2022 at 14:46 | comment | added | C3roe | Show us what you tried then at least. | |
S Feb 22, 2022 at 14:45 | review | First questions | |||
Feb 22, 2022 at 15:21 | |||||
S Feb 22, 2022 at 14:45 | history | asked | amit sutar | CC BY-SA 4.0 |