Pinn Well-known member Sep 1, 2014 #1 I Need a SQL Query for my Profil Field ID: fakecheck Option: benutzer_ungeprueft All User to the Option: benutzer_ungeprueft Does anyone know of the SQL query for this?
I Need a SQL Query for my Profil Field ID: fakecheck Option: benutzer_ungeprueft All User to the Option: benutzer_ungeprueft Does anyone know of the SQL query for this?
Amaury Well-known member Sep 1, 2014 #2 You will need to ask in the dedicated support sections if you want support. Upvote 0 Downvote
Pinn Well-known member Sep 1, 2014 #3 Yes, I need help, need an option show a SQL query to all allow in the profile field. Upvote 0 Downvote
Jake Bunce Well-known member Sep 1, 2014 #5 https://xenforo.com/community/threads/user-promotion-not-working.42391/#post-457365 Upvote 0 Downvote
Pinn Well-known member Sep 1, 2014 #6 Thanks, so ok:?? Code: INSERT INTO xf_user_field_value (user_id, field_id, field_value) SELECT user_id, 'fakecheck', 'benutzer_ungeprueft' FROM xf_user ON DUPLICATE KEY UPDATE field_value = VALUES(field_value); Upvote 0 Downvote
Thanks, so ok:?? Code: INSERT INTO xf_user_field_value (user_id, field_id, field_value) SELECT user_id, 'fakecheck', 'benutzer_ungeprueft' FROM xf_user ON DUPLICATE KEY UPDATE field_value = VALUES(field_value);
Jake Bunce Well-known member Sep 1, 2014 #7 Pinn said: Thanks, so ok:?? Code: INSERT INTO xf_user_field_value (user_id, field_id, field_value) SELECT user_id, 'fakecheck', 'benutzer_ungeprueft' FROM xf_user ON DUPLICATE KEY UPDATE field_value = VALUES(field_value); Click to expand... Correct. Upvote 0 Downvote
Pinn said: Thanks, so ok:?? Code: INSERT INTO xf_user_field_value (user_id, field_id, field_value) SELECT user_id, 'fakecheck', 'benutzer_ungeprueft' FROM xf_user ON DUPLICATE KEY UPDATE field_value = VALUES(field_value); Click to expand... Correct.
Pinn Well-known member Sep 1, 2014 #8 202 Datensätze eingefügt. ( Die Abfrage dauerte 0.0018 Sekunden ) Click to expand... It is however entered nothing for anyone. Upvote 0 Downvote
202 Datensätze eingefügt. ( Die Abfrage dauerte 0.0018 Sekunden ) Click to expand... It is however entered nothing for anyone.
Jake Bunce Well-known member Sep 1, 2014 #9 Jake Bunce said: ... Then rebuild the user cache: Admin CP -> Tools -> Rebuild Caches -> Rebuild User Caches Click to expand... Upvote 0 Downvote
Jake Bunce said: ... Then rebuild the user cache: Admin CP -> Tools -> Rebuild Caches -> Rebuild User Caches Click to expand...
Pinn Well-known member Sep 1, 2014 #11 Option is in Checkbox is that a Problem? Manual is okey. Upvote 0 Downvote
Jake Bunce Well-known member Sep 1, 2014 #12 Checkboxes are multi-select. Those values are stored as arrays. You will end up with a query like this: Rich (BB code): INSERT INTO xf_user_field_value (user_id, field_id, field_value) SELECT user_id, 'field_id', 'a:1:{s:5:"value";s:5:"value";}' FROM xf_user ON DUPLICATE KEY UPDATE field_value = VALUES(field_value); This is serialized data. Be careful that the string lengths match the value. Upvote 0 Downvote
Checkboxes are multi-select. Those values are stored as arrays. You will end up with a query like this: Rich (BB code): INSERT INTO xf_user_field_value (user_id, field_id, field_value) SELECT user_id, 'field_id', 'a:1:{s:5:"value";s:5:"value";}' FROM xf_user ON DUPLICATE KEY UPDATE field_value = VALUES(field_value); This is serialized data. Be careful that the string lengths match the value.
Pinn Well-known member Sep 1, 2014 #13 Yes it works: Code: INSERT INTO xf_user_field_value (user_id, field_id, field_value) SELECT user_id, 'fakecheck', 'a:1:{s:13:"benutzer_echt";s:19:"benutzer_ungeprueft";}' FROM xf_user ON DUPLICATE KEY UPDATE field_value = VALUES(field_value); Upvote 0 Downvote
Yes it works: Code: INSERT INTO xf_user_field_value (user_id, field_id, field_value) SELECT user_id, 'fakecheck', 'a:1:{s:13:"benutzer_echt";s:19:"benutzer_ungeprueft";}' FROM xf_user ON DUPLICATE KEY UPDATE field_value = VALUES(field_value);