php - Mysql INSERT INTO and UPDATE won't work properly -


  $ name = array ('maxgebruikers' = & gt; $ _POST ['maxgebruikers']); $ Name1 = सरणी ('maxplaylist' = & gt; $ _POST ['maxplaylist']); array_push ($ नाम, $ name1); $ Result = mysql_query ("सेलेक्ट * ऑर्गनाइजेशन_सेटिंग्स WHERE organisation_id = '{$ organisatieID}' '); यदि (mysql_fetch_assoc ($ परिणाम) == 0) {foreach ($ name as $ name = & gt; $ value) {mysql_query ("INGED IN organisation_settings (type, value, organization_id) VALUES ('{$ type}', '{ $ Value} ',' {$ organisatieID} ') "); print_r ($ नाम); }} और {foreach ($ name as $ name = & gt; $ value) {mysql_query ("UPDATE organisation_settings WHERE organization.org_id = '{$ organisatieID}' (प्रकार, मान, संगठन_आईडी) SET VALUES ('{$ type}', '' {$ Value} ',' {$ organisatieID} ') "); print_r ($ नाम); }}  

जैसा कि आप चित्र पर देख सकते हैं, मैं चाहता हूं कि कहां है

मेरी सरणी की तरह;

यह सही ढंग से सम्मिलित नहीं होगा, कोड में त्रुटि कहां और क्या है?

मुझे पता है कि मुझे mysqli फ़ंक्शन का प्रयोग करना चाहिए, लेकिन यह अब बात नहीं है।

आप $ name1 से $ नाम जोड़ने के लिए array_push का उपयोग करें तो आपका नाम सरणी अब ऐसा दिखता है:

  $ name = array ('maxgebruikers' = & gt; $ _POST ['maxgebruikers'], सरणी ('maxplaylist' = & gt; $ _POST [' maxplaylist ']));  

आपको अब अपने $ नाम सरणी में एक सरणी मिली है लेकिन जब आप इसे कॉल करते हैं, तो आप केवल इस $ नाम सरणी के दूसरे मान को कॉल करते हैं। उसके बाद आपको $ नाम एआरए के भीतर $ name1 सरणी का पहला मान कॉल करने की आवश्यकता है।

मुझे आशा है कि मेरा क्या मतलब होगा।


Comments

Popular posts from this blog

scala - Play Framework - how to bind form to a session field -

c++ - Why does Visual Studio Release build break on non-executing code line -

Firefox reacting to JQuery setTimeout that doesn't apply -