CREATE TABLE joke( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, joketext TEXT, jokedate DATE NOT NULL )DEFAULT CHARACTER SET utf8 CREATE TABLE author( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), email VARCHAR(255) )DEFAULT CHARACTER SET utf8
These tables created sucessful and i have entered data into them successful both manual and from using php, however, when i attempted to join both tables the i recieved the following message 'MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0012 sec )' i also notice that my authorid column within the joke table has NULL value as oppose to the respective id.
Could you please tell me where i am going wrong? Here is the syntax for the join using the 'ON' clause
SELECT * FROM joke INNER JOIN author ON authorid = author.id