|
Posted by Bart on 11/20/87 11:56
I got this code:
$addentry = "insert into
ipsheet(ipaddress,name,nat,pingresponse,dnsresolution,location,comments,sm,vlan,macaddress)
values
('$_POST[ipaddress]','$POST[name]','$POST[nat]','$_POST[pingresponse]','$_POST[dnsresolution]','$_POST[location]','$_POST[comments]','$_POST[sm]','$_POST[vlan]','$_POST[macaddress]')";
$rs = mysql_query($addentry);
if ($rs) echo ("<center><h3>New entry added
successully</h3></center>");
$audit = "insert into audit(user,type,sql) values
('$username','newentry','$addentry')";
echo $audit;
$rs = mysql_query($audit);
When I run that code the $audit looks like this:
insert into audit(user,type,sql) values ('test','newentry','insert into
ipsheet(ipaddress,name,nat,pingresponse,dnsresolution,location,comments,sm,vlan,macaddress)
values ('5.4.4.4','','','','test','test','test','test','test','test')')
but php does not like it so its not being insert into table.
How can I pass whole sql statement and insert it to table?
thx
Navigation:
[Reply to this message]
|