letskill Posted July 26, 2006 Share Posted July 26, 2006 It's a form but whatever you enter into the fields comes up blank in the database. Thanks in advance<?php $link = mysql_connect(-----------);if (!$link) { die('Could not connect: ' . mysql_error());}echo 'Connected successfully';$database = mysql_select_db('cs');print_r($_POST);$name = $_POST['textfield'];$specialty = $_POST['specialty'];$company = $_POST['company'];$address = $_POST['address'];$city = $_POST['city'];$state = $_POST['state'];$zip = $_POST['zip'];$telephone = $_POST['telephone'];$email = $_POST['email'];$licensure = $_POST['licensure'];$certifications = $_POST['certification'];$addcertifications = $_POST['addcertification'];$addcomments = $_POST['addcomment'];print($name);/*echo("$name");echo('\n');$sql = "INSERT INTO `Resume` VALUES('','" . $name . "'," . $specialty . ",'$company','$address','$city','$state','$zip','$telephone','$email','$licensure','$certifications','$addcertifications','$addcomments')";echo($sql);$error = mysql_query($sql); if ($error == TRUE) echo('\nfucking shit worked');else echo(mysql_error()); */mysql_close($link);?><form name="form1" method="post" action="thankyou.php"> <table width="100%" height="278" border="0" cellpadding="0" cellspacing="0" class="tablespace"> <tr> <td width="33%" height="278" valign="top" class="topform"><p>Registration <span class="style13">- Join our team of professionals and find the right job for you</span><br> <br> </p> <p><img src="images/groupdoc.gif" width="178" height="123"></p></td> <td width="67%" align="left" valign="top"><table width="100%" height="424" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="38%" height="28" align="right" valign="bottom" class="form">Name</td> <td width="62%" align="left" valign="bottom" class="inputspace"><input name="name" type="text"></td> </tr> <tr> <td height="28" align="right" valign="bottom">Specialty</td> <td align="left" valign="bottom" class="inputspace"><select name="specialty"> <option value="Allergist">Allergist</option> <option value="Anesthesiology">Anesthesiology</option> <option value="Cardiology">Cardiology</option> <option value="Critical Care">Critical Care</option> <option value="CRNA">CRNA</option> <option value="Dermatology">Dermatology</option> <option value="Emergency Medicine">Emergency Medicine</option> <option value="Endocrinology">Endocrinology</option> <option value="ENT">ENT</option> <option value="Family Practice">Family Practice</option> <option value="General Practice">General Practice</option> <option value="General Surgery">General Surgery</option> <option value="GI">GI</option> <option value="Hematology/Oncology">Hematology/Oncology</option> <option value="Hospitalist">Hospitalist</option> <option value="Infectious Disease">Infectious Disease</option> <option value="Internal Medicine">Internal Medicine</option> <option value="Medical Oncology">Medical Oncology</option> <option value="Neonatology">Neonatology</option> <option value="Nephrology">Nephrology</option> <option value="Neurology">Neurology</option> <option value="NeuroSurgery">NeuroSurgery</option> <option value="Nuclear Medicine">Nuclear Medicine</option> <option value="Nurse Practitioner">Nurse Practitioner</option> <option value="OB/GYN">OB/GYN</option> <option value="Occupational Medicine">Occupational Medicine</option> <option value="Oncology">Oncology</option> <option value="Opthalmology">Opthalmology</option> <option value="Ortho Surgery">Ortho Surgery</option> <option value="Pathology">Pathology</option> <option value="Pediatrics">Pediatrics</option> <option value="Perinatology">Perinatology</option> <option value="Physiatry">Physiatry</option> <option value="Primary Care">Primary Care</option> <option value="Psychiatry">Psychiatry</option> <option value="Psychology">Psychology</option> <option value="Pulmonary">Pulmonary</option> <option value="Radiation Oncology">Radiation Oncology</option> <option value="Radiation Therapy Technician">Radiation Therapy Technician</option> <option value="Radiology">Radiology</option> <option value="Rheumatology">Rheumatology</option> <option value="Thoracic Surgery">Thoracic Surgery</option> <option value="Urology">Urology</option> </select> </td> </tr> <tr> <td height="27" align="right" valign="bottom">Company Name </td> <td align="left" valign="bottom" class="inputspace"><input type="text" name="company"></td> </tr> <tr> <td height="27" align="right" valign="bottom">Address</td> <td align="left" valign="bottom" class="inputspace"><input type="text" name="address"></td> </tr> <tr> <td height="27" align="right" valign="bottom">City</td> <td align="left" valign="bottom" class="inputspace"><input type="text" name="city"></td> </tr> <tr> <td height="29" align="right" valign="bottom">State</td> <td align="left" valign="bottom" class="inputspace"><input type="text" name="state"></td> </tr> <tr> <td height="28" align="right" valign="bottom">Zip</td> <td align="left" valign="bottom" class="inputspace"><input type="text" name="zip"></td> </tr> <tr> <td height="30" align="right" valign="bottom">Telephone</td> <td align="left" valign="bottom" class="inputspace"><input type="text" name="telephone"></td> </tr> <tr> <td height="28" align="right" valign="bottom">Email</td> <td align="left" valign="bottom" class="inputspace"><input type="text" name="email"></td> </tr> <tr> <td height="32" align="right" valign="bottom">States of Licensure </td> <td align="left" valign="bottom" class="inputspace"><input type="text" name="licensure"></td> </tr> <tr> <td height="29" align="right" valign="bottom">Board of Certifications Status </td> <td align="left" valign="bottom" class="inputspace"><input type="text" name="certification"></td> </tr> <tr> <td height="30" align="right" valign="bottom">Additional Certifications </td> <td align="left" valign="bottom" class="inputspace"><input type="text" name="addcertification"></td> </tr> <tr> <td height="43" align="right" valign="bottom">Additonal Comments </td> <td align="left" valign="bottom" class="inputspace"><textarea name="addcomment"></textarea></td> </tr> <tr> <td height="38" align="right" valign="bottom"> </td> <td align="left" valign="bottom" class="inputspace"><input name="Submit" type="submit" class="inputspace" value="Submit"></td> </tr> </table></td> </tr> </table> </form> Quote Link to comment https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/ Share on other sites More sharing options...
Mantis_61 Posted July 26, 2006 Share Posted July 26, 2006 haven't looked at all your code yet but first test your database selection. I had the same problem and found my code was good but my priviliges were bad. MySQL will deny priviliges if your host and or db and table privs aren't specific. there are other ones that will load first. ie. annonymous. especially if there are more than one account with the same name. Quote Link to comment https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-63750 Share on other sites More sharing options...
AndyB Posted July 26, 2006 Share Posted July 26, 2006 Does the fact that you commented out the whole section to add to the database suggest a solution? Quote Link to comment https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-63755 Share on other sites More sharing options...
High_-_Tek Posted July 26, 2006 Share Posted July 26, 2006 Add an 'OR DIE ('Could not Execute Query Because: '.mysql_error()); to the end of your mysql_query statement Quote Link to comment https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-63778 Share on other sites More sharing options...
letskill Posted July 26, 2006 Author Share Posted July 26, 2006 [quote author=Mantis_61 link=topic=101860.msg403553#msg403553 date=1153874543]haven't looked at all your code yet but first test your database selection. I had the same problem and found my code was good but my priviliges were bad. MySQL will deny priviliges if your host and or db and table privs aren't specific. there are other ones that will load first. ie. annonymous. especially if there are more than one account with the same name.[/quote]Thanks, ill check that tomorrow and reply. Quote Link to comment https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-63788 Share on other sites More sharing options...
Rich464 Posted July 26, 2006 Share Posted July 26, 2006 why have you commented all this out?/*echo("$name");echo('\n');$sql = "INSERT INTO `Resume` VALUES('','" . $name . "'," . $specialty . ",'$company','$address','$city','$state','$zip','$telephone','$email','$licensure','$certifications','$addcertifications','$addcomments')";echo($sql);$error = mysql_query($sql);if ($error == TRUE) echo('\nfucking shit worked');else echo(mysql_error()); */How is your query going to work when you've commented the code out?AndyB got it straight away but you don't seem to have realised.... Quote Link to comment https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-63893 Share on other sites More sharing options...
redarrow Posted July 26, 2006 Share Posted July 26, 2006 [code]/*In php when we want to echo a lot about the code we work onwe use the fowardslash and astrack and then when finshed the longechoed message we use astrack then backslash to finish our long echoed message.This message is in the php format for an example remeber no code will exicute in this php format.*\[/code] Quote Link to comment https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-63896 Share on other sites More sharing options...
AndyB Posted July 26, 2006 Share Posted July 26, 2006 C'mom - read my earlier post. The code that you have commented out is NEVER going to be executed. Quote Link to comment https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-63982 Share on other sites More sharing options...
letskill Posted July 26, 2006 Author Share Posted July 26, 2006 Sigh guys, i realize that, but it still does the same thing. Quote Link to comment https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-64153 Share on other sites More sharing options...
AndyB Posted July 26, 2006 Share Posted July 26, 2006 OK, then post the current code you have running on your server. If nothing is going into the database then it sure looks like there's a database error of some sort. If I encounter that type of problem, I echo the query then try exactly the same query in phpMyAdmin.Might sound stupid, but you have uploaded the modified files to the right folder on your server, etc. haven't you? Quote Link to comment https://forums.phpfreaks.com/topic/15640-submit-forum-blanks/#findComment-64187 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.