I'm having problems with this query, I cant find anything wrong with it.
This is what it returns:
insert into tblrights (userID, rights, pan, orders, deposit, inventory, key, signature, cost, travel, reports, a) values ('00129411', 'non', 'yes', 'yes', '', '', '', '', '', '', '', 'a');
Here is my code:
if ($rights_drop == 'non') {
$query="insert into tblrights (userID, rights,";
$result=mysql_query("SELECT nav_name, ID FROM tblnav where type='home'");
if ($row = mysql_fetch_array($result)) {
do {
$query .= " $row[1], ";
} while($row = mysql_fetch_array($result));
$query .= " a) values ('$eID', '$rights_drop',";
}
$result=mysql_query("SELECT nav_name, ID FROM tblnav where type='home'");
if ($row = mysql_fetch_array($result)) {
do {
$query .= " '" . $_POST[$row[1]] . "', ";
} while($row = mysql_fetch_array($result));
$query .= " 'a');";
}
$results = mysql_query($query);
echo "$query";
}