Question about Insert Query = VERY URGENT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is an existing form where a user is asked if they would like 
to receive emails alerts and presently it is a radio button and it 
has 2 options Yes & No. By default Yes is selected. So in this case 
the data is captured.

Now we would like to change this where the same radio buttons would 
appear however none of them would be checked by default, so its upto 
the user to select Yes or No. In this case if the radio buttons are 
left blank then an error occurs from the php file. I have a code to 
check if the radio button was unchecked so that there would be no 
errors. the code is =

$receiveemails = empty($_POST['receiveemails']);
if($receiveemails) $receiveemails = "Blank checkbox"; else 
$receiveemails = $_POST["receiveemails"];

As of now the way the code is written is as follows which was 
written by another person which is =

insert into table(a,b,c) values($a,$b,%s, %s)

GetSQLValueString($_POST['specialOffers'], "text"),

MY QUESTION IS 

1. what is %s in the insert statement actually doing

2. what is GetSQLValueString($_POST['specialOffers'], "text") code 
actually doing

Please advice 

a) what this code is doing as if i implement my code this might have 
a drastic impact on how data is inserted into the table in mysql. As 
the "specialOffers" appears in lot many places in the php file.

b) what i can do with the existing code so that Even if a user does 
not select the radio button data should still be inserted into the 
table.

Even with a checkbox if it is left blank the same error happens just 
like radio button.

Any help will be greatly appreciated.



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux