Help please :)

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mikegotnaild
Forum Contributor
Posts: 173
Joined: Sat Feb 14, 2004 5:59 pm

Help please :)

Post by mikegotnaild »

I made a form and a script to put that data from the form into mysql. Well all form data is recorded to the data base correctly except for one column where they fill in their email address. Instead of recording the email address that i type in the form. It records it as '#Email' instead. What could be causing this? Heres my code:

This is the email form code

Email:<br>
<input type="text" name="email"size=20><br>

Now my action code:

Code: Select all

<?
//MySQL Variables. 
$host = "hostname";
$login_name = "username";
$password = "password";

//Connecting to MYSQL
MySQL_connect("$host","$login_name","$password");

//Select the database
MySQL_select_db("bandsandmembers") or die("Could not select database");

//Assign contents of form to variables
$bandname = $_POST&#1111;'band_name'];
$description = $_POST&#1111;'description'];
$history = $_POST&#1111;'history'];
$influences = $_POST&#1111;'influences'];
$genra = $_POST&#1111;'genra'];
$email = $_POST&#1111;'email'];
$website = $_POST&#1111;'website'];

$sql = "INSERT INTO nuke_bands (band_name, description, history, influences, genra, email, website) VALUES ('$bandname','$description','$history','$influences','$genra','#email','$website')";

$result = mysql_query($sql);

//Code to check if statement executed properly and display message
if ($result) &#123;
header("Location: http://naild.com/localmm/modules.php?name=Band_List&file=sent");
&#125; else &#123;
echo("An error has occured");
&#125;
//Close connection with MySQL
MySQL_close()
?>
[/quote]
nutstretch
Forum Contributor
Posts: 104
Joined: Sun Jan 11, 2004 11:46 am
Location: Leicester

Post by nutstretch »

You've used #email instead of $email

('$bandname','$description','$history','$influences','$genra','#email','$website')";
mikegotnaild
Forum Contributor
Posts: 173
Joined: Sat Feb 14, 2004 5:59 pm

Post by mikegotnaild »

umm.. I DIDNT EVEN SEE THAT!! IM BLIND!
mikegotnaild
Forum Contributor
Posts: 173
Joined: Sat Feb 14, 2004 5:59 pm

Post by mikegotnaild »

i got some kind of weird A.D.D. or somethin! :(
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

lol every programmer has to make them sort if mistakes here n there to make them better.
Post Reply