• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Creating MySQL tables for my newsletter forms


Karma

New Member
#1
How do I create MySQL tables for my newsletter forms?

I have the following fields in my form:
First Name
Last Name
DOB
Gender
Choose a city
Email Address

Any advise will be appreciated.
 

Karma

New Member
#3
Thanks Corrosive.

My MySQL knowledge isn't great, I've tried looking online for tutorials but no luck really on what I'm trying to do.

How would I go about creating my tables and fields in phpmyadmin?

Thanks.
 

Corrosive

Well-Known Member
#4
Thanks Corrosive.

My MySQL knowledge isn't great, I've tried looking online for tutorials but no luck really on what I'm trying to do.

How would I go about creating my tables and fields in phpmyadmin?

Thanks.
It's not going to be that easy to explain in a forum post because there are many different options such as integers, varchar, blobs etc. Perhaps start and ask more specific questions as you go.
 

Edge

Active Member
#6
I'd be looking around for some off the shelf software that manages it all for you - wordpress and newsletter plugins do it. I can't remember the last time I created a table for mysql as that's not the way it's done anymor - it's all about configuring avaiable packages than dealing directly with a database.
 

Corrosive

Well-Known Member
#7
I'd be looking around for some off the shelf software that manages it all for you - wordpress and newsletter plugins do it. I can't remember the last time I created a table for mysql as that's not the way it's done anymor - it's all about configuring avaiable packages than dealing directly with a database.
Yes, that is a very good point. Or even sign up for a mailchimp account and let them handle all your data.
 

Karma

New Member
#9
Well it's just a form for people to submit their email address' basically on a splashpage.

This is the code I've got for my database:

<?php
$con = mysql_connect("localhost","eventsha_wrdp1","dRWq2u+M30?*");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}


mysql_select_db("eventsha_wrdp1", $con);


$sql="INSERT INTO Persons (FirstName, LastName, D/O/B, Gender, City, Email)
VALUES
('$_POST[firstname]','$_POST[lastname]','$_POST[dob]','$_POST[gender]','$_POST[city]','$_POST')";


if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";


mysql_close($con);
?>
[/QUOTE]

I'm just struggling to link that to my database, hopefully this [URL="http://i44.tinypic.com/s4we4h.png"]image[/URL] might help?

No worries if I'm being pretty vague.