sorry all i ever seam to do here is ask questions:(
but im really stuck on the best way to do this
what i have is 2 tables and im trying to make a 3rd table for compatibility
example
table 1
id
data
name
data1
table2
id
data
supplier
data2
what i want is a 3rd table
table3
id
table1 id
table2 id
thats easy but i want a php way of easy editing ti
main page
list all opetions in table 1 as links
[php]<?php
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect(" localhost","use rname","passwor d");
//select which database you want to edit
mysql_select_db ("database") ;
//select the table
$result = mysql_query("se lect * from table1");
//grab all the content
while($r=mysql_ fetch_array($re sult))
{
//the format is $variable = $r["nameofmysqlcol umn"];
//modify these to match your mysql table columns
$id=$r["id"];
$data=$r["data"];
$name=$r["name"];
$data1=$r["data1"];
//display the row
echo "<a href='main1.php ?id=$id'>add compatibility for $name </a><br>";
}
?>[/php]the main1.php
on this one i want to show all the items in table 2 with check boxes
you can check the boxes and then when submit it adds an entry into table 3 for each cecked option
example
id table1_id table2_id
1,1,1
2,1,2
3,1,3
ect
where id is the table 3 id
table1_id is the id from table 1 ( passed through the link)
table2_id is the id from table 2 ( pulled down in this page)
its this page i am not sure how to do . i can do the pull down fine but doing the check boxes and the table insert i am unsure of
andy help will be greatly recived
2nd remark: Please enclose your posted code in [code] tags (See How to Ask a Question).
This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.
Please use [code] tags in future.
MODERATOR