Hi,
I’m bumping this up as I really need a solution
The relevant code is below. The programme runs ok, no warnings or errors. The newly created table keywordbook is loaded but only with the booknumber, keywordid remains empty. I have tried all manner of ways of coding the source field but to no avail. The echo just confirms what’s happened. The number or records is correct but where or how do I find that field?
Thanks
Mike
PS I’ve removed the error statements for clarity.
$result0 = mysqli_query
($link, 'SELECT booknumber FROM keywords
INNER JOIN keywordtab
ON keywords.keyword = keywordtab.keyword');
WHILE ($row = mysqli_fetch_array($result0))
{
echo $keywordid," - ",$row['booknumber'],"<br />";
$sql = 'INSERT INTO keywordbook SET
keywordid = "' . keywordtab.keywordid . '",
booknumber = "' . $row['booknumber'] . '"';
};
$keywordid is never defined, so I suppose you meant $row[‘keywordid’] , assuming ‘keywordid’ is a column in one of the two tables
keywordtab.keywordid does not have a $ in front of it, so it’s not a variable, but will be treated as a constant, or -if it is not defined as a constant- a string. However, I think you want the value of the column ‘keywordid’ in the keywordtab table, in which case it should simply be $row[‘keywordid’]
I get booknumber ok which is in the row but where is the info from the second - keywordtab - table? I tried row but keywordid doesn’t exist there. The output fields all remain empty, zero.
What now?