kenoli Posted February 19, 2021 Author Share Posted February 19, 2021 PPS -- Actually, I just now got both errors when I ran it with the conditional. The fact that it repeated the error three times as indicated above would indicate that the fatal error didn't occur that time. When I just ran it, it did. The errors returned are inconsistent. Here are the two errors: Warning: Undefined array key "title" in /Users/studio/Sites/BannerProject/b-as/_test_site/__classes/upload_images.php on line 71 (on the conditional line) Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in /Users/studio/Sites/BannerProject/b-as/_test_site/__classes/upload_images.php:72 Stack trace: #0 /Users/studio/Sites/BannerProject/b-as/_test_site/__classes/upload_images.php(72): PDOStatement->execute(Array) #1 {main} thrown in /Users/studio/Sites/BannerProject/b-as/_test_site/__classes/upload_images.php on line 72 (on the "execute" line) Quote Link to comment https://forums.phpfreaks.com/topic/312164-adding-elements-from-one-multidimensional-array-to-another/page/2/#findComment-1584633 Share on other sites More sharing options...
kenoli Posted February 19, 2021 Author Share Posted February 19, 2021 18 minutes ago, Barand said: name="1['title']" ^ ^ remove those single quotes in all inout names It works! I guess html doesn't like quotes in array elements. Hooray. Many thanks, I guess we're good to go. Sorry for how long it took. I appreciate your persistence. --Kenoli Quote Link to comment https://forums.phpfreaks.com/topic/312164-adding-elements-from-one-multidimensional-array-to-another/page/2/#findComment-1584634 Share on other sites More sharing options...
Barand Posted February 19, 2021 Share Posted February 19, 2021 In PHP, string indexes for arrays should be quoted. I am talking about the HTML in your form. You are naming the input field as "['title']" instead of "[title]" Quote Link to comment https://forums.phpfreaks.com/topic/312164-adding-elements-from-one-multidimensional-array-to-another/page/2/#findComment-1584636 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.