Im trying to join two tables together becouse 2 columns match and i need info from second table to display the content. When i pressing a link with ?p=1a i want content to show and this info i have on the second table but not the first one. Where table 1 and table 2 match on column Menu. I have shorten down on some code/table info becouse its not relevant for this problem. im then displaying the info with mysql_fetch_assoc.
TABLE 1
MENU | subtitle | firstname |info
info | contact
word | woord
TABLE 2
MENU | page |
info | 1a
word | 1b
My code:
if(isset($_GET['p'])){
$page = $_GET['p'];
$find = mysqli_query("SELECT * FROM testcheck, testdoc INNER JOIN testdoc ON testcheck.Menu = testdoc.MENU AND page='$page' ");
while($row = mysqli_fetch_assoc($find)){
$subtitle = $row['subtitle'];
$firstname = $row['firstname'];
echo $firstname
}
}
Problem is correct kinda now but only letters work fine but when i combine page='1a' for example everything stop works.