MySQL Forums
Forum List  »  General

MySQL join, help needed
Posted by: sn202
Date: March 14, 2005 10:54AM

Hi all,

I'm pretty new to MySQL and I don't really get the whole join thing, although I understand the theory behind it I have problems when putting it into practice. Basically I'm using PHP with MySQL back end and I've got two tables:

TEST
QUESTION

The primary key of Test is "testno" which is an auto_increment and question has "testno" as a foreign key, so I need a join that will insert the value of "testno" into question when ever a record is entered into TEST based on the "testname" which the user enters into a form.

Let me try and clarify:

$testname = $_POST['testname'];
sql="INSERT into question test.testno where testname = '$testname'";

Obviously this will not work but what I need in effect is a query which carries out this function.

Any help will be much appreciated.

Simon.

Options: ReplyQuote


Subject
Written By
Posted
MySQL join, help needed
March 14, 2005 10:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.