Registration

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vadlak
Forum Newbie
Posts: 1
Joined: Sun May 16, 2010 1:46 pm

Registration

Post by vadlak »

Can anyone help me out with this

Code: Select all

<?php

@mysql_connect("localhost","Blah", "Blah") or die("Cannot connect to DB!");
@mysql_select_db("hwhelper_User") or die("Cannot select DB!");
$Username = $_POST['Username'];
$Password =  $_POST['Password'];
$Email = $_POST['Email'];
$sql="INSERT INTO tbl_login (Username, Password, Email) VALUES (".$Username.",".$Password.",".$Email.")";
$r = mysql_query($sql);
if(!$r) {
$err=mysql_error();
print $err;
exit();
}

?>
I am trying to get it to write it to the Mysql database and yes i know the password and username say blah
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Registration

Post by requinix »

Echo out your query and see if it looks correct to you.

And for heaven's sake, use mysql_real_escape_string.
Post Reply