Creating MySQL tables for my newsletter forms

Karma

New Member
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.
 
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.
 
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.
 
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.
 
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.
 
I was gonna suggest MailChimp too. I know a lot of people use it and it takes the hassle out of doing it yourself.
 
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.
 
Back
Top