Dominee Posted August 10, 2011 Share Posted August 10, 2011 Hello all, I made a join form for my website. I got a problem with it and I cant figure out what it is. Ill hope you can help me. Here is my problem When I wanna register myself on my website it will give this error: Field 'id' doesn't have a default value I've added some pictures and my code below, please take a look. My join form is not in the root map, but in the map /member/join_form.php This is the code of my join_form.php <?php // Set error message as blank upon arrival to page $errorMsg = ""; // First we check to see if the form has been submitted if (isset($_POST['username'])){ //Connect to the database through our include include_once "connect_to_mysql.php"; // Filter the posted variables $username = ereg_replace("[^A-Za-z0-9]", "", $_POST['username']); // filter everything but numbers and letters $country = ereg_replace("[^A-Z a-z0-9]", "", $_POST['country']); // filter everything but spaces, numbers, and letters $state = ereg_replace("[^A-Z a-z0-9]", "", $_POST['state']); // filter everything but spaces, numbers, and letters $city = ereg_replace("[^A-Z a-z0-9]", "", $_POST['city']); // filter everything but spaces, numbers, and letters $accounttype = ereg_replace("[^a-z]", "", $_POST['accounttype']); // filter everything but lowercase letters $email = stripslashes($_POST['email']); $email = strip_tags($email); $email = mysql_real_escape_string($email); $password = ereg_replace("[^A-Za-z0-9]", "", $_POST['password']); // filter everything but numbers and letters // Check to see if the user filled all fields with // the "Required"(*) symbol next to them in the join form // and print out to them what they have forgotten to put in if((!$username) || (!$country) || (!$state) || (!$city) || (!$accounttype) || (!$email) || (!$password)){ $errorMsg = "Niet alles is correct ingevuld!<br /><br />"; if(!$username){ $errorMsg .= "--- Gebruikersnaam"; } else if(!$country){ $errorMsg .= "--- Land"; } else if(!$state){ $errorMsg .= "--- Staat"; } else if(!$city){ $errorMsg .= "--- Stad"; } else if(!$accounttype){ $errorMsg .= "--- Account Type"; } else if(!$email){ $errorMsg .= "--- Email Adres"; } else if(!$password){ $errorMsg .= "--- Wachtwoord"; } } else { // Database duplicate Fields Check $sql_username_check = mysql_query("SELECT id FROM members WHERE username='$username' LIMIT 1"); $sql_email_check = mysql_query("SELECT id FROM members WHERE email='$email' LIMIT 1"); $username_check = mysql_num_rows($sql_username_check); $email_check = mysql_num_rows($sql_email_check); if ($username_check > 0){ $errorMsg = "<u>ERROR:</u><br />Deze gebruikersnaam is al in gebruik, probeer een ander."; } else if ($email_check > 0){ $errorMsg = "<u>ERROR:</u><br />Deze email is al in gebruik, probeer een ander."; } else { // Add MD5 Hash to the password variable $hashedPass = md5($password); // Add user info into the database table, claim your fields then values $sql = mysql_query("INSERT INTO members (username, country, state, city, accounttype, email, password, signupdate) VALUES('$username','$country','$state','$city','$accounttype','$email','$hashedPass', now())") or die (mysql_error()); // Get the inserted ID here to use in the activation email $id = mysql_insert_id(); // Create directory(folder) to hold each user files(pics, MP3s, etc.) mkdir("memberFiles/$id", 0755); // Start assembly of Email Member the activation link $to = "$email"; // Change this to your site admin email $from = "admin@poetsproduct.nl"; $subject = "De laatste stap!"; //Begin HTML Email Message where you need to change the activation URL inside $message = ' Hallo ' . $username . ', U bent bijna klaar om in te loggen!<br> Volg deze laatste stap om uw account te activeren. Klik hier om uw account te activeren >> <a href="http://www.poetsproduct.nl/activation.php?id=' . $id . '"> Activeer nu!</a> Dit zijn uw login gegevens: E-mail Adres: ' . $email . ' Wachtwoord: ' . $password . ' Met vriendelijke groet, Poetsproduct.nl Janw******** 15***, Wo********** _________________________________________________ Heeft u een vraag? Neem contact op met onze klantenservice. Email: Con************* Tel: 061********* '; // end of message $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; $to = "$to"; // Finally send the activation email to the member mail($to, $subject, $message, $headers); // Then print a message to the browser for the joiner print "<br /><br /><br /><h4>Ok $firstname, dit is de laatste stap om uw account te activeren:</h4><br /> We hebben u net een activerings email gestuurd naar: $email<br /><br /> <strong><font color=\"#990000\">Kijk ook in uw ongewenste post</font></strong> het kan zijn dat uw spamfilter onze mail tegen houd. <br /> Nadat uw account is geactiveerd kunt u inloggen."; exit(); // Exit so the form and page does not display, just this success message } // Close else after database duplicate field value checks } // Close else after missing vars check } //Close if $_POST ?> <?php session_start(); // Must start session first thing $toplinks = ""; if (isset($_SESSION['id'])) { // Put stored session variables into local php variable $userid = $_SESSION['id']; $username = $_SESSION['username']; $toplinks = '<a href="http://www.poetsproduct.nl/member/member_profile.php?id=' . $userid . '">U bent ingelogd als ' . $username . '</a> • <a href="http://www.poetsproduct.nl/member/logout.php">Log uit</a>'; } else { $toplinks = '<a href="http://www.poetsproduct.nl/member/join_form.php">Registreren</a> • <a href="http://www.poetsproduct.nl/member/login.php">Login</a>'; } ?> <html> <head> <title>Poetsproduct | Registreren</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- #Table_01 tr td { font-family: Arial, Helvetica, sans-serif; } #Table_01 tr td { font-size: 12px; } body { background-image: url(../Style/Stroke.png); background-repeat: repeat-x; } #Over_ons { color: #D4E3FB; font-weight: bold; } #SN { font-size: 14px; } #None { font-size: 12px; } --> </style> <script type="text/javascript"> <!-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../images/Rollover/Home.png','../images/Rollover/Assortiment.png','../images/Rollover/Over ons.png','../images/Rollover/Verzenden.png','../images/Rollover/Betalen.png','../images/Rollover/Contact.png','../images/Rollover/Facebook.png','../images/Rollover/Twitter.png','../images/Rollover/Hyves.png')"> <table align="center" id="Table_01" width="1201" height="951" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="2" rowspan="4"> <img src="../images/New-15-07-update_01.png" width="58" height="75" alt=""></td> <td colspan="4" rowspan="5"> <img src="../images/New-15-07-update_02.png" width="267" height="80" alt=""></td> <td colspan="10"> <img src="../images/New-15-07-update_03.png" width="875" height="9" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="9" alt=""></td> </tr> <tr> <td rowspan="3"> <img src="../images/New-15-07-update_04.png" width="9" height="66" alt=""></td> <td> <a href="http://www.facebook.com/pages/PoetsProduct/236503569702627"> <img src="../images/New-15-07-update_05.png" alt="" width="20" height="20" border="0" id="Image7" onMouseOver="MM_swapImage('Image7','','../images/Rollover/Facebook.png',1)" onMouseOut="MM_swapImgRestore()"></a></td> <td rowspan="3"> <img src="../images/New-15-07-update_06.png" width="1" height="66" alt=""></td> <td> <a href="https://twitter.com/#!/PoetsProduct"> <img src="../images/New-15-07-update_07.png" alt="" width="20" height="20" border="0" id="Image8" onMouseOver="MM_swapImage('Image8','','../images/Rollover/Twitter.png',1)" onMouseOut="MM_swapImgRestore()"></a></td> <td rowspan="3"> <img src="../images/New-15-07-update_08.png" width="1" height="66" alt=""></td> <td> <a href="http://hyves.nl/?pageid=AAXGFZMH1OG0O0C4K"> <img src="../images/New-15-07-update_09.png" alt="" width="20" height="20" border="0" id="Image9" onMouseOver="MM_swapImage('Image9','','../images/Rollover/Hyves.png',1)" onMouseOut="MM_swapImgRestore()"></a></td> <td rowspan="3"> <img src="../images/New-15-07-update_10.png" width="12" height="66" alt=""></td> <td rowspan="3"> <img src="../images/New-15-07-update_11.png" width="305" height="66" alt=""></td> <td width="382" height="33" rowspan="2" align="left" background="../images/New-15-07-update_12.png" alt=""><?php echo $toplinks; ?></td> <td rowspan="29"> <img src="../images/New-15-07-update_13.png" width="105" height="941" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="20" alt=""></td> </tr> <tr> <td rowspan="2"> <img src="../images/New-15-07-update_14.png" width="20" height="46" alt=""></td> <td rowspan="2"> <img src="../images/New-15-07-update_15.png" width="20" height="46" alt=""></td> <td rowspan="2"> <img src="../images/New-15-07-update_16.png" width="20" height="46" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="13" alt=""></td> </tr> <tr> <td background="../images/New-15-07-update_17.png" width="382" height="33" alt=""><div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=229946050359156&xfbml=1"></script><fb:like href="http://www.facebook.com/pages/PoetsProduct/236503569702627" send="true" layout="button_count" width="300" show_faces="false" font="arial"></fb:like> </td> <td> <img src="../images/spacer.gif" width="1" height="33" alt=""></td> </tr> <tr> <td rowspan="26"> <img src="../images/New-15-07-update_18.png" width="57" height="875" alt=""></td> <td rowspan="2"> <img src="../images/New-15-07-update_19.png" width="1" height="25" alt=""></td> <td colspan="9" rowspan="2"> <img src="../images/New-15-07-update_20.png" width="770" height="25" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="5" alt=""></td> </tr> <tr> <td colspan="4"> <img src="../images/New-15-07-update_21.png" width="267" height="20" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="20" alt=""></td> </tr> <tr> <td colspan="14"> <img src="../images/New-15-07-update_22.png" width="1038" height="4" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="4" alt=""></td> </tr> <tr> <td background="../images/New-15-07-update_22-24.png" width="1038" height="38" alt="" colspan="14"> </td> <td> <img src="../images/spacer.gif" width="1" height="38" alt=""></td> </tr> <tr> <td colspan="14"> <img src="../images/New-15-07-update_24.png" width="1038" height="3" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="3" alt=""></td> </tr> <tr> <td colspan="3"> <a href="http://www.Poetsproduct.nl/index.php"> <img src="../images/New-15-07-update_24-26.png" alt="" width="157" height="29" border="0" id="Image1" onMouseOver="MM_swapImage('Image1','','../images/Rollover/Home.png',1)" onMouseOut="MM_swapImgRestore()"></a></td> <td rowspan="21"> <img src="../images/New-15-07-update_26.png" width="14" height="805" alt=""></td> <td width="867" height="805" colspan="10" rowspan="21" align="left" valign="top" background="../images/New-15-07-update_27.png" alt=""><table id="Table_01" width="865" height="350" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="393" height="175" align="left" valign="top"><p style="font-size: 24px; font-weight: bold; color: #D4E3FB;"><table width="600" align="center" cellpadding="5"> <form action="join_form.php" method="post" enctype="multipart/form-data"> <tr> <td colspan="2"><font color="#FF0000"><?php echo "$errorMsg"; ?></font></td> </tr> <tr> <td width="163"><div align="right">Gebruikersnaam:</div></td> <td width="409"><input name="username" type="text" value="<?php echo "$username"; ?>" /></td> </tr> <tr> <td><div align="right">Land:</div></td> <td><select name="country"> <option value="<?php echo "$country"; ?>"><?php echo "$country"; ?></option> <option value="Nederland">Nederland</option> </select></td> </tr> <tr> <td><div align="right">Staat: </div></td> <td><input name="state" type="text" value="<?php echo "$state"; ?>" /></td> </tr> <tr> <td><div align="right">Woonplaats: </div></td> <td> <input name="city" type="text" value="<?php echo "$city"; ?>" /> </td> </tr> <tr> <td><div align="right">Account Type: </div></td> <td><select name="accounttype"> <option value="<?php echo "$accounttype"; ?>"><?php echo "$accounttype"; ?></option> <option value="a">Normal User</option> </select></td> </tr> <tr> <td><div align="right">Email: </div></td> <td><input name="email" type="text" value="<?php echo "$email"; ?>" /></td> </tr> <tr> <td><div align="right"> Wachtwoord: </div></td> <td><input name="password" type="password" value="<?php echo "$password"; ?>" /> <font size="-2" color="#006600">(Alleen letters en cijfers, geen spaties of symbolen)</font></td> </tr> <tr> <td><div align="right"></div></td> <td> </td> </tr> <tr> <td><div align="right"></div></td> <td><input type="submit" name="Submit" value="Ga verder" /></td> </tr> </form> </table> </p> <p style="font-size: 24px; font-weight: bold; color: #D4E3FB;">Voordelen </p> <p style="font-size: 12px;"><span>Registreer u nu op poetsproduct.nl en ontvang meer voordeel.</span></p> <p style="font-size: 12px;">Voordelen bij het registreren:<br> - U krijgt instructies hoe u uw auto moet poetsen.<br> - Ontvang een overzicht met ons gehele assortiment en de prijslijst in uw email.<br> - Ontvang onze nieuwsbrief in uw postvak.<br> - Proviteer van onze aanbiedingen.</p> <p><br> <span style="font-size: 12px; font-weight: bold; color: #D4E3FB;"><br> </span></td> </tr> <tr> <td height="175" align="left" valign="top"> </td> </tr> </table> <p> </p></td> <td> <img src="../images/spacer.gif" width="1" height="29" alt=""></td> </tr> <tr> <td colspan="3"> <img src="../images/New-15-07-update_28.png" width="157" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="1" alt=""></td> </tr> <tr> <td colspan="3"> <a href="http://www.Poetsproduct.nl/Assortiment.php"> <img src="../images/New-15-07-update_28-30.png" alt="" width="157" height="26" border="0" id="Image2" onMouseOver="MM_swapImage('Image2','','../images/Rollover/Assortiment.png',1)" onMouseOut="MM_swapImgRestore()"></a></td> <td> <img src="../images/spacer.gif" width="1" height="26" alt=""></td> </tr> <tr> <td colspan="3"> <img src="../images/New-15-07-update_30.png" width="157" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="1" alt=""></td> </tr> <tr> <td colspan="3"> <a href="http://www.Poetsproduct.nl/Over_ons.php"> <img src="../images/New-15-07-update_30-32.png" alt="" width="157" height="25" border="0" id="Image3" onMouseOver="MM_swapImage('Image3','','../images/Rollover/Over ons.png',1)" onMouseOut="MM_swapImgRestore()"></a></td> <td> <img src="../images/spacer.gif" width="1" height="25" alt=""></td> </tr> <tr> <td colspan="3"> <img src="../images/New-15-07-update_32.png" width="157" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="1" alt=""></td> </tr> <tr> <td colspan="2"> <a href="http://www.Poetsproduct.nl/Verzenden.php"> <img src="../images/New-15-07-update_32-34.png" alt="" width="156" height="25" border="0" id="Image4" onMouseOver="MM_swapImage('Image4','','../images/Rollover/Verzenden.png',1)" onMouseOut="MM_swapImgRestore()"></a></td> <td rowspan="9"> <img src="../images/New-15-07-update_34.png" width="1" height="284" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="25" alt=""></td> </tr> <tr> <td colspan="2"> <img src="../images/New-15-07-update_35.png" width="156" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="1" alt=""></td> </tr> <tr> <td colspan="2"> <a href="http://www.Poetsproduct.nl/Betalen.php"> <img src="../images/New-15-07-update_35-37.png" alt="" width="156" height="25" border="0" id="Image5" onMouseOver="MM_swapImage('Image5','','../images/Rollover/Betalen.png',1)" onMouseOut="MM_swapImgRestore()"></a></td> <td> <img src="../images/spacer.gif" width="1" height="25" alt=""></td> </tr> <tr> <td colspan="2"> <img src="../images/New-15-07-update_37.png" width="156" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="1" alt=""></td> </tr> <tr> <td rowspan="11"> <img src="../images/New-15-07-update_38.png" width="1" height="670" alt=""></td> <td> <a href="http://www.Poetsproduct.nl/Contact.php"> <img src="../images/New-15-07-update_38-40.png" alt="" width="155" height="27" border="0" id="Image6" onMouseOver="MM_swapImage('Image6','','../images/Rollover/Contact.png',1)" onMouseOut="MM_swapImgRestore()"></a></td> <td> <img src="../images/spacer.gif" width="1" height="27" alt=""></td> </tr> <tr> <td> <img src="../images/New-15-07-update_40.png" width="155" height="30" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="30" alt=""></td> </tr> <tr> <td> <img src="../images/New-15-07-update_41.png" width="155" height="25" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="25" alt=""></td> </tr> <tr> <td width="155" height="137" align="center" background="../images/New-15-07-update_42.png" alt=""><img src="../Style/ideal-65.jpg" width="65" height="57"> <img src="../Style/safepay-65.jpg" width="64" height="65"><img src="../Style/paypal_verified-65.jpg" width="45" height="55"></td> <td> <img src="../images/spacer.gif" width="1" height="137" alt=""></td> </tr> <tr> <td> <img src="../images/New-15-07-update_43.png" width="155" height="13" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="13" alt=""></td> </tr> <tr> <td colspan="2"> <img src="../images/New-15-07-update_44.png" width="156" height="25" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="25" alt=""></td> </tr> <tr> <td width="156" height="158" colspan="2" align="left" valign="top" background="../images/New-15-07-update_45.png" alt=""><p style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">Poetsproduct.nl staat ingeschreven in het handelsregister bij de <br> Kamer van Koophandel <br> Onder nummer: 53150074<br> <br> Het BTW-indentificatienummer van poetsproduct.nl is: NL850769164B01</p></td> <td> <img src="../images/spacer.gif" width="1" height="158" alt=""></td> </tr> <tr> <td colspan="2"> <img src="../images/New-15-07-update_46.png" width="156" height="13" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="13" alt=""></td> </tr> <tr> <td> <img src="../images/New-15-07-update_47.png" width="155" height="24" alt=""></td> <td rowspan="3"> <img src="../images/New-15-07-update_48.png" width="1" height="242" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="24" alt=""></td> </tr> <tr> <td width="155" height="159" align="left" valign="top" background="../images/New-15-07-update_49.png" alt=""> <script src="http://widgets.twimg.com/j/2/widget.js"></script> </td> <td> <img src="../images/spacer.gif" width="1" height="159" alt=""></td> </tr> <tr> <td> <img src="../images/New-15-07-update_50.png" width="155" height="59" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="59" alt=""></td> </tr> <tr> <td> <img src="../images/spacer.gif" width="57" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="155" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="14" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="97" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="9" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="20" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="20" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="1" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="20" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="12" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="305" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="382" height="1" alt=""></td> <td> <img src="../images/spacer.gif" width="105" height="1" alt=""></td> <td></td> </tr> </table> </body> </html> And this is the code of the file connecting to MySQL <?php /* 1: "die()" will exit the script and show an error statement if something goes wrong with the "connect" or "select" functions. 2: A "mysql_connect()" error usually means your username/password are wrong 3: A "mysql_select_db()" error usually means the database does not exist. */ // Place db host name. Sometimes "localhost" but // sometimes looks like this: >> ???mysql??.someserver.net $db_host = "mysql1.mijnhostingpartner.nl"; // Place the username for the MySQL database here $db_username = "Poe******"; // Place the password for the MySQL database here $db_pass = "Rij*****"; // Place the name for the MySQL database here $db_name = "Poe*******"; // Run the actual connection here mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql"); mysql_select_db("$db_name") or die ("no database"); ?> Thanks, Mitch [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/244368-problems-with-my-join-form/ Share on other sites More sharing options...
jcbones Posted August 10, 2011 Share Posted August 10, 2011 Your id field should be set to 'Primary Key' and 'Auto_increment'. Quote Link to comment https://forums.phpfreaks.com/topic/244368-problems-with-my-join-form/#findComment-1255121 Share on other sites More sharing options...
Dominee Posted August 10, 2011 Author Share Posted August 10, 2011 So what to change with what, I dont understand Quote Link to comment https://forums.phpfreaks.com/topic/244368-problems-with-my-join-form/#findComment-1255317 Share on other sites More sharing options...
Morg. Posted August 10, 2011 Share Posted August 10, 2011 -- if your id is indeed an int(, else modify ALTER TABLE whatever CHANGE id id int( PRIMARY KEY NOT NULL AUTO_INCREMENT; Quote Link to comment https://forums.phpfreaks.com/topic/244368-problems-with-my-join-form/#findComment-1255320 Share on other sites More sharing options...
Dominee Posted August 10, 2011 Author Share Posted August 10, 2011 Sorry but I still dont understand, im not good in databases :-\ Quote Link to comment https://forums.phpfreaks.com/topic/244368-problems-with-my-join-form/#findComment-1255331 Share on other sites More sharing options...
Morg. Posted August 10, 2011 Share Posted August 10, 2011 yeah .. smileys don't help in code either -- ALTER TABLE whatever CHANGE id id int( PRIMARY KEY NOT NULL AUTO_INCREMENT; There you go. And if you are not good in databases, take the time to learn a bit, it's worth it as you seem to be working with one. Quote Link to comment https://forums.phpfreaks.com/topic/244368-problems-with-my-join-form/#findComment-1255336 Share on other sites More sharing options...
Dominee Posted August 10, 2011 Author Share Posted August 10, 2011 Now I have it like the image below. Can you tell me if this is the right way ? Thanks [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/244368-problems-with-my-join-form/#findComment-1255345 Share on other sites More sharing options...
Dominee Posted August 10, 2011 Author Share Posted August 10, 2011 Now it says: Field 'bio' doesn't have a default value ? Help would be nice Quote Link to comment https://forums.phpfreaks.com/topic/244368-problems-with-my-join-form/#findComment-1255348 Share on other sites More sharing options...
TeNDoLLA Posted August 10, 2011 Share Posted August 10, 2011 This happens for that field and probably for the rest of the fields that are not included in your INSERT query also because you have defined the fields to be NOT NULL, which means they must have a value when new row is inserted. And in you insert query you do not insert value in 'bio' field, now the database will look for the default value to fill in that field, but you have not defined any default value. Quote Link to comment https://forums.phpfreaks.com/topic/244368-problems-with-my-join-form/#findComment-1255397 Share on other sites More sharing options...
jcbones Posted August 11, 2011 Share Posted August 11, 2011 I usually let my columns have null values, unless I define a default value. Quote Link to comment https://forums.phpfreaks.com/topic/244368-problems-with-my-join-form/#findComment-1255662 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.