You are here: Problem with queries format « PHP Programming Language « IT news, forums, messages
Problem with queries format

Posted by Bart on 10/10/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация