Im having a problem inserting the following data into a Mysql table, just wondering if any one has any ideas on how to get it to work. When i click the register button nothing at all happens . any one got any ideas.
<?php
$connection = mysql_connect("localhost", "root", "")
or die ("Could not connect to server");
$db = mysql_select_db('customer', $connection) or die('could not connect to DB' .mysql_error());
$query = "INSERT INTO customerdetails (custID, userName, title, password, custFirstName, custLastName, email, address1, address2, address3, country, telephone) VALUES (4,'$u', PASSWORD('$p'),'','$fn', '$ln', '$e','', '', '', '', '')";
?>
<form action="home.php"><fieldset>
<legend>Enter your information in the form below:</legend>
<p><b>First Name:</b> <input type="text" name="custFirstName" size="15" maxlength="15" value="<?php if (isset($_POST['custFirstName'])) echo $_POST['custFirstName']; ?>" /></p>
<p><b>Last Name:</b> <input type="text" name="custLastName" size="30" maxlength="30" value="<?php if (isset($_POST['custLastName'])) echo $_POST['custLastName']; ?>" /></p>
<p><b>Email Address:</b> <input type="text" name="email" size="40" maxlength="40" value="<?php if (isset($_POST['email'])) echo $_POST['email']; ?>" /> </p>
<p><b>User Name:</b> <input type="text" name="userName" size="10" maxlength="20" value="<?php if (isset($_POST['userName'])) echo $_POST['userName']; ?>" /></p>
<p><b>Password:</b> <input type="password" name="password1" size="20" maxlength="20" /></p>
<p><b>Confirm Password:</b> <input type="password" name="password2" size="20" maxlength="20" /></p>
</fieldset>
<div align="center"><input type="submit" name="submit" value="Register" /></div>
</form>
1 1410 - $query = "INSERT INTO customerdetails (custID, userName, title, password, custFirstName, custLastName, email, address1, address2, address3, country, telephone) VALUES (4,'$u', PASSWORD('$p'),'','$fn', '$ln', '$e','', '', '', '', '')";
it is mean that you are using
'$u' variable for userName
'$p' for title
and so on... . -
-
<p><b>First Name:</b> <input type="text" name="custFirstName" size="15" maxlength="15" value="<?php if (isset($_POST['custFirstName'])) echo $_POST['custFirstName']; ?>" /></p>
-
if you use "custFirstName" as your first name
you must declare on the query
and also the query is not send to the mysql with "mysql_query" command
example -
<?php
-
$query=mysql_query("insert into costumerdetails (userID, firstName, lastName) values (4, '$firstName', '$lastName')");
-
if($query)
-
echo "Register Complete";
-
?>
-
<form action="" method="post">
-
First Name <input type='text' name='firstName'><br>
-
Last Name <input type="text" name=lastName'><br>
-
<input type='submit' values='register'>
-
</form>
-
hope usefull... .
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mechphisto |
last post by:
I'm using a textarea to insert some notes into a database.
It's inserting the complete result into the mySQL table including the
linebreaks...and not as a visible symbol but an actual linebreak. If...
|
by: perplexed |
last post by:
How do you convert a user inputted date to a unix timestamp before
insterting it into your database? I have a form, with a textfield for
a date that the user inputs in the format mm-dd-yyyy and...
|
by: Raqueeb Hassan |
last post by:
Hello There!
Have you guys tried inserting variables in mySQL tables? Do I have to
use 'quote' as we had been doing to insert strings?
mysql> INSERT INTO occurrence (word_id,page_id) VALUES...
|
by: Ben |
last post by:
I don't know whether anyone can help, but I have an odd problem. I have
a PSP (Spyce) script that makes many calls to populate a database. They
all work without any problem except for one...
|
by: Ajm113 |
last post by:
Ok, when I was new to this I had this problem and I bet a lot of other people did when they where new to PHP and Mysql. So this mite be your question;
"Ok, no errors or warnings in mysql and php so...
|
by: gp |
last post by:
I am and have been using PDO for about a year now...and have finally
gotten around to solving the "DB NULL value" issues I ran into early
on...
I am looking for suggestions and techniques to...
|
by: djmeltdown |
last post by:
I'm having trouble getting a foreach() loop to insert a record into a MySQL Database. Which I've never had any trouble before, it just seems quirky.
I've tried the mysql_query statement without a...
|
by: len |
last post by:
Hi All
I have started a little pet project to learn python and MySQL. The
project involves figuring out all the combinations for a 5 number
lottery and storing the data in a MySQL file.
The...
|
by: Bunty |
last post by:
I am not beginer of this language. I've worked on this language for 2
or 3 months.But now i have a problem to inserting values in the
database.It gives me error that DATABASE NOT SELECTED.
I am...
|
by: Bunty |
last post by:
I want to insert values in the database.If i insert values one by one
then it works till 4 or 5 fields then after it gives error.In my
database there are more than 20 field.Pls help me.
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |