Hi
next little issue
I have successfully joined two tables together and got the data pulled in from the two tables, now I need to pull data from a third table that contains 3 different dates for different item_id numbers so one is car mot date, second is car insurance date and the third is car tax date
The code I put in profile.php is below
[code=php]
$sql = “SELECT * FROM users INNER JOIN visitors on visitors.visitor_id = visitors.visitor_id INNER JOIN renewal on visitors.visitor_id = visitors.visitor_id WHERE users.id = $id LIMIT 1”;
then bit further below, I have the echo code
echo “<p>Car MOT Expiry Date: {$user[‘renewal_date’]}</p>”;
echo “<p>Car Insurance Expiry Date: {$user[‘renewal_date’]}</p>”;
echo “<p>Car TAX Expiry Date: {$user[‘renewal_date’]}</p>”;
obviously that just outputs the same date on each row
my database structure for the renewal table is below
— phpMyAdmin SQL Dump
— version 4.0.7
— Host: localhost
— Generation Time: Jun 29, 2015 at 09:46 AM
— Server version: 5.5.42
— PHP Version: 5.3.28
SET SQL_MODE = “NO_AUTO_VALUE_ON_ZERO”;
SET time_zone = “+00:00”;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION
/*!40101 SET NAMES utf8
—
—
CREATE TABLE IF NOT EXISTS `renewal
`renewal_id
`visitor_id
`item_id
`renewal_date
`date_notified
PRIMARY KEY (`renewal_id
KEY `renewal_id`renewal_id
KEY `renewal_id_2`renewal_id
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=181 ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION