cancel button code is also wrong
<input type="reset" name="Cancel"
value="Exit">
My Submit login wont store
Moderator: General Moderators
- phazorRise
- Forum Contributor
- Posts: 134
- Joined: Mon Dec 27, 2010 7:58 am
Re: My Submit login wont store
Thanks..Done that bt am now having issue like dis below;
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Address, Phone Number) VALUES('Mr', '07283063', 'femimif', 'femimi','oyedele','o' at line 1
Sorry if i distract u a lot today..
Error Extracted from:
<?php
include('dbconnect.php');
$Title =$_POST['Title'];
$MatricNo =$_POST['MatricNo'];
$Password =$_POST['Password'];
$RPassword = $_POST['RPassword'];
$Surname =$_POST['Surname'];
$Firstname =$_POST['Firstname'];
$Lastname =$_POST['Lastname'];
$State=$_POST['State'];
$Sex =$_POST['Sex'];
$Department =$_POST['Department'];
$Level =$_POST['Level'];
$EmailAddress =$_POST['EmailAddress'];
$PhoneNumber =$_POST['PhoneNumber'];
if(isset($_POST['Register']))
{
$sql= "INSERT into student_details(Title, MatricNo, Password, RPassword, Surname, Firstname , Lastname ,State, Sex, Department, Level, Email Address, Phone Number) VALUES('$Title', '$MatricNo', '$Password', '$RPassword','$Surname','$Firstname','$Lastname','$State', '$Sex', '$Department','$Level','$EmailAddress', '$PhoneNumber')" ;
}
mysql_query($sql) or die (mysql_error());
echo "You have successfully registered";
?>
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Address, Phone Number) VALUES('Mr', '07283063', 'femimif', 'femimi','oyedele','o' at line 1
Sorry if i distract u a lot today..
Error Extracted from:
<?php
include('dbconnect.php');
$Title =$_POST['Title'];
$MatricNo =$_POST['MatricNo'];
$Password =$_POST['Password'];
$RPassword = $_POST['RPassword'];
$Surname =$_POST['Surname'];
$Firstname =$_POST['Firstname'];
$Lastname =$_POST['Lastname'];
$State=$_POST['State'];
$Sex =$_POST['Sex'];
$Department =$_POST['Department'];
$Level =$_POST['Level'];
$EmailAddress =$_POST['EmailAddress'];
$PhoneNumber =$_POST['PhoneNumber'];
if(isset($_POST['Register']))
{
$sql= "INSERT into student_details(Title, MatricNo, Password, RPassword, Surname, Firstname , Lastname ,State, Sex, Department, Level, Email Address, Phone Number) VALUES('$Title', '$MatricNo', '$Password', '$RPassword','$Surname','$Firstname','$Lastname','$State', '$Sex', '$Department','$Level','$EmailAddress', '$PhoneNumber')" ;
}
mysql_query($sql) or die (mysql_error());
echo "You have successfully registered";
?>
Re: My Submit login wont store
Okay...I hope u will help me with lot more and will keep feeding u back...Thanks
- phazorRise
- Forum Contributor
- Posts: 134
- Joined: Mon Dec 27, 2010 7:58 am
Re: My Submit login wont store
Column names should be single quoted. And it's good practice to check for magic quotes and according to that add or strip slashes from user input.
Character type values be quoted not numbers. Plus, I wouldn't give a column name containing blank space like "Email Address". Instead i would use "Email_address". You can also use http://php.net/manual/en/function.mysql-real-escape-string.php to make query more safer.
if you have phpmyadmin installed and configured then you can practice working with query's and it can generate php code for each operation.
So you can see what mistakes you are making.
Character type values be quoted not numbers. Plus, I wouldn't give a column name containing blank space like "Email Address". Instead i would use "Email_address". You can also use http://php.net/manual/en/function.mysql-real-escape-string.php to make query more safer.
if you have phpmyadmin installed and configured then you can practice working with query's and it can generate php code for each operation.
So you can see what mistakes you are making.
Re: My Submit login wont store
I really appreciate our tutorials phazorRise...Thanks very much still working on it..
Re: My Submit login wont store
I really appreciate ur contributions. I have been able to sort it out. Thanks very much...
How can a generate a php code to create and admin page where the admin will be able to search the names of registered students?
How can a generate a php code to create and admin page where the admin will be able to search the names of registered students?