This topic is locked

Do I need to join 2 tables

4/4/2008 2:22:44 PM
PHPRunner General questions
B
bochaka author

I am working with the trial 4.2 version and much of this is new to me.I noted in the example on table relation ships each of the tables has 1 common field. So i created 2 tables of my own and included in each a fields of the same name ( user name ), do i some how need to tell the software that this field is comon to each table so that if i select user name from table a it will display the user name data from table b.
I thought if i made table a the master table then i could make its username field the master key and the make the username field in table b as the foreign key, but after making table a the master table with its user name field as master key , when i select foreign key the username field or indeed none of the fields from table b are there, TABLE a fields are there.

Will making a join sort this and how do i do it, I know litttle about the code stuff.

Sergey Kornilov admin 4/4/2008

Probably you need to explain what tables you have and what you trying to build.
In this case it would be easier for someone to provide a solid advice.

B
bochaka author 4/4/2008

Probably you need to explain what tables you have and what you trying to build.

In this case it would be easier for someone to provide a solid advice.



I am trying to build a form where users who put their personal information into table a, can select answers from questions in table b, table a has their personal details and table b is their answers which is a large selection of mainly drop down boxes with yes and no, ther are also some text areas where they answer pre defined questions

B
bochaka author 4/4/2008



I am trying to build a form where users who put their personal information into table a, can select answers from questions in table b, table a has their personal details and table b is their answers which is a large selection of mainly drop down boxes with yes and no, ther are also some text areas where they answer pre defined questions



Think I got it sorted but after I uploaded to server i get this message when i goto the index.htm page

Smarty error: unable to write to $compile_dir '/home/cormac/public_html/db1/templates_c'. Be sure $compile_dir is writable by the web server user.

I havnt got a clue what it means or how to sort it.Any help appreciated

B
bochaka author 4/5/2008

Now when I upload my files i get this
Warning: main(locale.php) [function.main]: failed to open stream: No such file or directory in /home/cormac/public_html/include/dbcommon.php on line 40
Warning: main(locale.php) [function.main]: failed to open stream: No such file or directory in /home/cormac/public_html/include/dbcommon.php on line 40
Warning: main() [function.include]: Failed opening 'locale.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/cormac/public_html/include/dbcommon.php on line 40
Warning: main(events.php) [function.main]: failed to open stream: No such file or directory in /home/cormac/public_html/include/dbcommon.php on line 41
Warning: main(events.php) [function.main]: failed to open stream: No such file or directory in /home/cormac/public_html/include/dbcommon.php on line 41
Warning: main() [function.include]: Failed opening 'events.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/cormac/public_html/include/dbcommon.php on line 41
Warning: main(dbconnection.php) [function.main]: failed to open stream: No such file or directory in /home/cormac/public_html/include/dbcommon.php on line 43
Warning: main(dbconnection.php) [function.main]: failed to open stream: No such file or directory in /home/cormac/public_html/include/dbcommon.php on line 43
Warning: main() [function.include]: Failed opening 'dbconnection.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/cormac/public_html/include/dbcommon.php on line 43
Fatal error: Call to undefined function: db_connect() in /home/cormac/public_html/login.php on line 21
HHHEEEEEEELLLLLLLPPPPPPPPPPPPPP

Sergey Kornilov admin 4/6/2008

Make sure /home/cormac/public_html/db1/templates_c directory is writable by web server user. You can do this setting 766 permissions on templates_c folder.
Usually you can use your website control panel to set permissions. Contact your web hosting company in this regard.