Linny
Junior Member
Posts: 263
inherit
115575
0
Jul 30, 2012 13:11:24 GMT -8
Linny
263
December 2007
linny58
|
Post by Linny on Jan 19, 2010 8:58:44 GMT -8
It seems I visit here once every few months when I need some SQL help :/ Anyway the latest problem, I am developing my new tournament site to go along with my website, as you can see there is a form there and all the data goes through to my database table but no information shows its just blank fields, You'll probably need screenshots and stuff so just tell me what you need. Thank you
|
|
inherit
100824
0
May 13, 2012 5:37:49 GMT -8
Michael
14,585
March 2007
wrighty
|
Post by Michael on Jan 19, 2010 9:08:55 GMT -8
Well, we would need the coding that you're using. Blank out passwords, but the coding to store & retrieve the info. Also, the database structure would help!
|
|
Linny
Junior Member
Posts: 263
inherit
115575
0
Jul 30, 2012 13:11:24 GMT -8
Linny
263
December 2007
linny58
|
Post by Linny on Jan 19, 2010 9:29:35 GMT -8
No problem.
Index.html / form -
<FORM ACTION="formindb.php" METHOD="POST" NAME="contact_form"> <TABLE> <TR> <TD><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Your name</font></TD> <TD> <input type=text name="Name"></TD> </TR> <TR> <TD><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Your email</font></TD> <TD><input type=text name="Email"></TD> </TR> <TR> <TD><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gamertag</font></TD> <TD> <input type=text name="Gamertag"></TD> </TR> <TR> <TD><font size="2" face="Verdana, Arial, Helvetica, sans-serif">I have read the <a href="/tournaments/Agreement.html">Agreement</a></font></TD> <TD> <input type=checkbox name="Agreement"></TD> </TR> <TR> <TD><input type="submit" value="Submit" name="Submit"></TD> <TD><input type="reset" value="Reset" name="Reset"></TD> </TR> </TABLE> </FORM>
formindb.php / sends the data to the DB -
<?php $con = mysql_connect("localhost","mikewhis_jeff","******"); //Replace with your actual MySQL DB Username and Password if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("mikewhis_tourn", $con); //Replace with your MySQL DB Name $Name=mysql_real_escape_string($_POST['']); //This value has to be the same as in the HTML form file $Email=mysql_real_escape_string($_POST['KDR']); //This value has to be the same as in the HTML form file $Gamertag=mysql_real_escape_string($_POST['username']); //This value has to be the same as in the HTML form file $Agreement=mysql_real_escape_string($_POST['email']); //This value has to be the same as in the HTML form file $sql="INSERT INTO ffa (Name,Email,Gamertag,Agreement) VALUES ('$Name','$Email','$Gamertag','$Agreement')"; /*form_data is the name of the MySQL table where the form data will be saved. name and email are the respective table fields*/ if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "Congratulations! we have successfully received your application, keep on checking the website and your email account for more information!"; mysql_close($con); ?>
I'm trying to find the button that shows all your table in code, will a screenshot do?
|
|
Linny
Junior Member
Posts: 263
inherit
115575
0
Jul 30, 2012 13:11:24 GMT -8
Linny
263
December 2007
linny58
|
Post by Linny on Jan 19, 2010 15:09:11 GMT -8
Sorry, Still can't find it. Will this screenshot do?
|
|
inherit
96206
0
Apr 8, 2024 11:48:08 GMT -8
S|P|L|A|T
1,324
January 2007
splatcatballa99
|
Post by S|P|L|A|T on Jan 19, 2010 15:58:03 GMT -8
Well your trying to post information from inputs that don't exist, thats your problem. I don't see KDR, Username, and Email is lowercase, and name has a blank value? read the comments on each variable and you answer your own question?
|
|
Linny
Junior Member
Posts: 263
inherit
115575
0
Jul 30, 2012 13:11:24 GMT -8
Linny
263
December 2007
linny58
|
Post by Linny on Jan 20, 2010 7:23:49 GMT -8
Oh Great! Stupid mistake, the KDR and everything else is there from another time I used a script like this (I C n P'd it)
Now that's embarrassing, thanks for the help!
|
|