vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Inserting array into database (https://vborg.vbsupport.ru/showthread.php?t=103938)

Lionel 12-29-2005 02:10 AM

Inserting array into database
 
I have this for retrieving multiple checkboxes values (I never know how many because they are dynamically generated)

PHP Code:

$foo2 $_POST['predplayer2'];
if (
count($foo2) > 0) { 
     for (
$i=0;$i<count($foo2);$i++) {     
        
$tplayer2="$foo2[$i]|"
     } 


When I echo $tplayer2;

I have player1|player2|player3| etc...

when I do my insert, only one value goes in there player1|

I do
PHP Code:

...,'$tplayer2',... 


joelabq 12-29-2005 02:40 AM

What does you insert code look like?

Joel

Lionel 12-29-2005 03:33 AM

1 Attachment(s)
Thanks Joel, I have a talent to complicate matters. I found it with the pointer you gave me on serialize, very, very simple indeed:

PHP Code:

 $tplayer1 serialize($_POST['predplayer1']); 

Serializing them to put them in database was easy. Unserializing them is fine too. However placing those values in their boxes and checking off the proper checkboxes is no picnic. this image is the page the member gets if he wants to edit the values. Putting the score is a piece of cake, but the section below... geeeeeeeee!!!!!!


All times are GMT. The time now is 10:11 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01027 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete