bev Posted October 21, 2008 Share Posted October 21, 2008 The code below is suppose to post the information from the filled form to a form inside an admin panel..However it now does not post or show anyone registered at all from the page this code is on.. It did work . Some minor changes were made ( from here $variable = $_POST['variable']; to here $result= mysql_query($sql); was added) now it will not post in the admin.. Does anyone see what would cause this? if($_POST[btnSubmit]=="Submit") { $checkusernmae=mysql_num_rows(mysql_query("select * from user_registration where email='$_POST' and contact_name='$_POST[contact]'")); if($checkusernmae == 0) { $insert="insert into user_registration(company_name,contact_name,address,city,state,country,zipcode,phone,email,pword,package,created_date,cctype,ccnumber,ccmonth,ccyear,ccv,fname,lname,comment) value('$_POST[company]','$_POST[contact]','$_POST[address]','$_POST[city]','$_POST[state]','$_POST[country]','$_POST[zipcode]','$_POST[phone]','$_POST','$_POST[passwrd]','$_POST[group1]',now(),'$_POST[cctype]','$_POST[ccnumber]','$_POST[Month]','$_POST[Year]','$_POST[ccv]','$_POST[fname]','$_POST[lname]','$_POST[comment]')','"; //echo $insert;exit; mysql_query($insert); $variable = $_POST['variable']; $sql="insert into orders(sitemembership,clientmembership,sellitemsmembership,auctionitemsmembership,shoppingcrt3months,shoppingcart6months,shoppingcrt1year) value('[sitemembership]','$_POST[clientmembership]','$_POST[sellitemsmembership]','$_POST[auctionitemsmembership]','$_POST[shoppingcrt3months]', '$_POST[shoppingcrt6months]','$_POST[shoppingcrt1year]','$_POST[companyname]')','"; $result= mysql_query($sql); Quote Link to comment https://forums.phpfreaks.com/topic/129492-code-not-posting/ Share on other sites More sharing options...
MadTechie Posted October 21, 2008 Share Posted October 21, 2008 change the last line form $result= mysql_query($sql); to $result= mysql_query($sql) or die(mysql_error()); and check any errors, theirs lots of Notices type error but their want kill the script Quote Link to comment https://forums.phpfreaks.com/topic/129492-code-not-posting/#findComment-671335 Share on other sites More sharing options...
bev Posted October 22, 2008 Author Share Posted October 22, 2008 Now this appears AFTER I click the submit button and is still not posting to the admin section ??? This is the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '','' at line 3 Quote Link to comment https://forums.phpfreaks.com/topic/129492-code-not-posting/#findComment-671344 Share on other sites More sharing options...
AndyB Posted October 22, 2008 Share Posted October 22, 2008 Your query defines seven fields and eight variables. companyname got omitted from the fields list. The fix should be obvious. Quote Link to comment https://forums.phpfreaks.com/topic/129492-code-not-posting/#findComment-671351 Share on other sites More sharing options...
MadTechie Posted October 22, 2008 Share Posted October 22, 2008 Letting us know the errors may help a little! AndyB as pointed out a problem that need to be resolved.. Quote Link to comment https://forums.phpfreaks.com/topic/129492-code-not-posting/#findComment-671354 Share on other sites More sharing options...
bev Posted October 22, 2008 Author Share Posted October 22, 2008 Yeah MadTechie I forgot to add the code there.. I pasted it in though so you can see it now.. I just corrected what AndyB found wrong and then retried but I get the same thing You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '','' at line 3 Quote Link to comment https://forums.phpfreaks.com/topic/129492-code-not-posting/#findComment-671361 Share on other sites More sharing options...
MadTechie Posted October 22, 2008 Share Posted October 22, 2008 did you remove the last comma & single quote ? me]')','"; can you post the updated code please Quote Link to comment https://forums.phpfreaks.com/topic/129492-code-not-posting/#findComment-671375 Share on other sites More sharing options...
bev Posted October 22, 2008 Author Share Posted October 22, 2008 I did remove the last comma & single quote and now receive this error Unknown column 'sellitemsmembership' in 'field list' Quote Link to comment https://forums.phpfreaks.com/topic/129492-code-not-posting/#findComment-671401 Share on other sites More sharing options...
AndyB Posted October 22, 2008 Share Posted October 22, 2008 That's because you do not have a field in your database table with exactly that name. Quote Link to comment https://forums.phpfreaks.com/topic/129492-code-not-posting/#findComment-671405 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.