Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Programming and Game Development (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=34)
-   -   Insert Data/Tables Trouble (http://www.mysidiaadoptables.com/forum/showthread.php?t=3669)

AlexC 05-03-2012 07:25 PM

Insert Data/Tables Trouble
 
So somedays I'm a total noob with coding. I need to have someone enter info into a form, have the info put into a database, and then I'll pull it and display it.

I have the form done (I think) and the pulling part I /think/ I'm good with. I'm having trouble getting the info into the table though. Mostly because I don't know how to set up a table.

Code:

<?php
$con = mysql_connect("localhost","gloometh_me","**********"); //Replace with your actual MySQL DB Username and Password
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("gloometh_adopts", $con);
$code=mysql_real_escape_string($_POST['code']);
$sql="INSERT INTO clicks (code) VALUES ('$code')";
if (!mysql_query($sql,$con)) {
die('Error: ' . mysql_error());
}
echo "The form data was successfully added to your database.";
mysql_close($con);
?>

This is my submitting page - I think its alright. I just need some help setting up a table to hold the data. Help please?

SilverDragonTears 05-03-2012 07:40 PM

I can help you... skype?

AlexC 05-03-2012 07:44 PM

I guess, sure.


All times are GMT -5. The time now is 01:46 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.