Jump to content


Photo

One to many (/)


  • Please log in to reply
2 replies to this topic

#1 bluedogatdingdong

bluedogatdingdong
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationPenzance, Cornwall

Posted 17 August 2004 - 01:41 PM

Hi

Another problem I can't get my head around.

I am trying to insert an record into a table but one of the fields is a lookup to another table ...... (this bit works okay) ...... but I need to be able to make multiplue selections.

Althougn it looks like you can selct more than one, it only adds 1 record.

See example at http://www.cornwallw...dtwotables1.php

Username: diaryeditor
Password: havefun

I've cheated at the moment and passworded the whole directory - next job will be to set up a proper loggin system!


#2 ReD_BeReT

ReD_BeReT
  • Members
  • Pip
  • Newbie
  • 2 posts
  • LocationSwitzerland

Posted 17 August 2004 - 04:20 PM

I have the same problem... here is the solution:

You must only put this brackets to the name of the (?) input tag:
<select name="sample[]">

WIth the []-brackets the name is not a variable, its a array... the array you canread with foreach or for.

#3 bluedogatdingdong

bluedogatdingdong
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationPenzance, Cornwall

Posted 18 August 2004 - 11:22 AM

I have tried your suggestion and it won't insert a record at all now!

Sorry I am a real begginer, do I have to alter anything else?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users