|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
A Framework for Persisting Data Relationships
Can anyone help me modify Jakes script from the article.
I have changed what I think is necessary to make it work, the form works and tells me to check the database but no records are added. My database contains the following tables etc. cd_artists ========== Artist_ID CompactDisc_Artist cd_compactdiscs =============== CompactDisc_ID CompactDisc_Title cd_artist2cd ============ Artist_ID CompactDisc_ID I think the problem is to do with the arrays. php Code:
|
|
#2
|
|||
|
|||
|
RE: A Framework for Persisting Data Relationships
Im not the smartest at arrays but array(array(
dosent seem right. Why not just use: array('bla', 'bla'); Instead of having: $my_array = array(array('Test1,'Test2');); Array - 1. array- 1. Test1 2. Test2 Why not have $my_array = array('Test1', 'Test2'); Array- 1. Test1 2. Test2 It is alot simpler |
|
#3
|
|||||
|
|||||
|
RE: A Framework for Persisting Data Relationships
drevele,
the original code with the arrays works fine. I have tried to change it to work with my cd tables and I cant see where I'm going wrong. I presume that its to do with the variables and database fields. In the example php Code:
firstname and lastname are database fields Any ideas |
|
#4
|
|||||
|
|||||
|
RE: A Framework for Persisting Data Relationships
php Code:
When is $this->table defined? |
|
#5
|
|||
|
|||
|
RE: A Framework for Persisting Data Relationships
The tables are defined in each of the classes / functions. $this-> table etc.
|
|
#6
|
|||
|
|||
|
RE: A Framework for Persisting Data Relationships
I think that the problem is coming from the database structure not working with the sql command that is generated, the tutorial says that
Quote:
having your id columns with names Artist_ID, ..., the sql does not execute properly (can't fill out the id field) |
|
#7
|
|||||
|
|||||
|
RE: A Framework for Persisting Data Relationships
Thanks for the advice superalloy.
I changed the database fields as suggested. However, I still can't update the database - somethings still wrong. Can you help. My database tables and fields are cd_artist2cd ============ id artist cd cd_artist ========= id CompactDisc_Artist cd_compactdisc ============== id CompactDisc_Title The code php Code:
|
|
#8
|
|||
|
|||
|
RE: A Framework for Persisting Data Relationships
Are the id fields autonumber?
Sorry I didn't mean to resolve the thread. |
|
#9
|
|||
|
|||
|
RE: A Framework for Persisting Data Relationships
Yes, the id fields are autonumber.
|
![]() |
| Viewing: Codewalkers Forums > Other > Tutorials > A Framework for Persisting Data Relationships |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|