Hi there.
First post but have been lurking a little while and learning a lot.
I have this problem and I'm not sure what I'm missing or doing wrong.
I have a function in a page that validates input fields.
Depending on what the user clicked it sets a URL variable to '1' or '2'
Now after validation goes through it's paces I get to my function.
include 'con.php'; //config file for DB etc.
include 'opencon.php'; // opens connection to db.
function navCheck($method_add) {
if ( $method_add == "1" ) {
mysql_query ("INSERT INTO ims_item (id_item) VALUES ('txt_stock_id_add')"); // txt_sock_id_add is a textfield in a form.
echo "Datase 1 inserted";
}elseif($method_add =='2' ){
echo "Dataset 2 inserted";
}
}
navCheck($method_add);
This produces a Dataset 1 inserted on screen or Dataset 2 on screen from the other url but there is no data in the DB and I get no error whatsover. Neither inline code or output.
Is it possible that my includes are messign this up or is my SQL wrong?