Click to See Complete Forum and Search --> : [RESOLVED] addslashes problem


Humper
10-17-2006, 01:52 PM
I cant seem to get this to work... I think I have the quotes in the wrong spot?


$insert = "INSERT INTO OfficeComputers(Site_Code, OS, DHCP, IP, Gateway, DNS, MAC, VerifyIP, Purpose, RunUpdate, ScheduleUpdate, AVvendor, AVExpiration, RunSpyScan, CheckConn, FlushDNS, CheckVPN, CheckRD, CheckMRI, CheckPrinting, Notes) VALUES('addslashes($p_SiteName)', 'addslashes($p_OS)', 'addslashes($p_DHCP)', 'addslashes($p_IP)', 'addslashes($p_Gateway)', 'addslashes($p_DNS)', 'addslashes($p_MAC)', 'addslashes($p_VerifyIP)','addslashes($p_Purpose)', 'addslashes($p_RunUpdate)', 'addslashes($p_ScheduleUpdate)', 'addslashes($p_AVvendor)', 'addslashes($p_AVExpiration)', 'addslashes($p_RunSpyScan)', 'addslashes($p_CheckConn)', 'addslashes($p_FlushDNS)', 'addslashes($p_CheckVPN)', 'addslashes($p_CheckRD)', 'addslashes($p_CheckMRI)', 'addslashes($p_CheckPrinting)', 'addslashes($p_Notes)')";


can someone help please

chazzy
10-17-2006, 02:58 PM
Did you try to see what the actual problem is?

$insert = "INSERT INTO OfficeComputers(Site_Code, OS, DHCP, IP, Gateway, DNS, MAC, VerifyIP, Purpose, RunUpdate, ScheduleUpdate, AVvendor, AVExpiration, RunSpyScan, CheckConn, FlushDNS, CheckVPN, CheckRD, CheckMRI, CheckPrinting, Notes)
VALUES('addslashes($p_SiteName)', 'addslashes($p_OS)', 'addslashes($p_DHCP)', 'addslashes($p_IP)', 'addslashes($p_Gateway)', 'addslashes($p_DNS)', 'addslashes($p_MAC)', 'addslashes($p_VerifyIP)','addslashes($p_Purpose)', 'addslashes($p_RunUpdate)', 'addslashes($p_ScheduleUpdate)', 'addslashes($p_AVvendor)', 'addslashes($p_AVExpiration)', 'addslashes($p_RunSpyScan)', 'addslashes($p_CheckConn)', 'addslashes($p_FlushDNS)', 'addslashes($p_CheckVPN)', 'addslashes($p_CheckRD)', 'addslashes($p_CheckMRI)', 'addslashes($p_CheckPrinting)', 'addslashes($p_Notes)')";
$result = mysql_query($insert) or die(mysql_error());

Humper
10-17-2006, 04:51 PM
fixed it...

had to make it look like this for the input
'".addslashes($p_DHCP)."'