473,748 Members | 2,690 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Still some issues

Hello,
Everything is beginning to work, but there are still a few issues left.
Please forgive my ignorance and hence stupid questions (Newbie).
I can now enter data with no problem, I get no errors, however, when I
check the contents of my DB, 2 fields display nothing.
The Fields PostCode (VARCHAR(10)) NOT NULL and
Email (VARCHAR(80)) NOT NULL
both remain empty in the database although I have entered data.
Like I said, I get no error messages after completion of the form.
If it helps, here is the PHP file to enter everything:
<html>
<head><title>Te st MySQL</title></head>
<style>
body{
scrollbar-arrow-color: #00FF00;
scrollbar-3dlight-color: #333333;
scrollbar-highlight-color: #33FF33;
scrollbar-face-color: #000000;
scrollbar-shadow-color: #00CC00;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #000000;
}
</style>
<body bgcolor="#00000 0" text="#00FF00" link="#FFFF00" vlink="#CCFFFF"
alink="#99CC00" >
<!-- mysql_up.php -->
<?php
$host="everyweb host.com";
$user="radiokvo _enrol";
$password="**** ******";
mysql_connect($ host,$user,$pas sword);
mysql_select_db ($user);
$Name=$_POST['Name'];
$FirstNames=$_P OST['FirstNames'];
$DOB=$_POST['DOB'];
$Sex=$_POST['Sex'];
$Address=$_POST['Address'];
$Town=$_POST['Town'];
$County=$_POST['County'];
$PostCode=$_POS T['PostCode'];
$Telephone=$_PO ST['Telephone'];
$Mobile=$_POST['Mobile'];
$Fax=$_POST['Fax'];
$Email=$_POST['Email'];
$Course=$_POST['Course'];
$OtherCourse=$_ POST['OtherCourse'];
$SessionType=$_ POST['SessionType'];
$OtherDuration= $_POST['OtherDuration'];
$NumberOfStuden ts=$_POST['NumberOfStuden ts'];
$query = "INSERT into Names
(Name,FirstName s,DOB,Sex,Addre ss,Town,County, PostCode,Teleph one,Mobile,Fax, Email,Course,Ot herCourse,Sessi onType,OtherDur ation,NumberOfS tudents)
VALUES
('$Name','$Firs tNames','$DOB', '$Sex','$Addres s','$Town','$Co unty','$PostCod e','$Telephone' ,'$Mobile','$Fa x','$Email','$C ourse','$OtherC ourse','$Sessio nType','$OtherD uration','$Numb erOfStudents')" ;
$result = mysql_query($qu ery)
or die ("Couldn't execute query");
?>
</body>
</html>

And this is the form HTML code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<!-- Created with the CoffeeCup HTML Editor 2005 -->
<!-- http://www.coffeecup.com/ -->
<!-- Brewed on 15/08/2005 15:31:15 -->
<head>
<title>Enrolmen ts</title>
<meta name="generator " content="Coffee Cup HTML Editor 2005D -
www.coffeecup.c om">
<meta name="descripti on" content="">
<meta name="keywords" content="">
<style>
body{
scrollbar-arrow-color: #00FF00;
scrollbar-3dlight-color: #333333;
scrollbar-highlight-color: #33FF33;
scrollbar-face-color: #000000;
scrollbar-shadow-color: #00CC00;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #000000;
}
</style>
</head>
<body bgcolor="#00000 0" text="#00FF00" link="#FFFFFF" vlink="#33CCCC"
alink="#FF0000" >
<div align="center"> <font size="5">The Enrolment Page</font></div><br>
On this page you can enrol online, or, if you have already registered by
phone or other means, pass on your details so we can adjust our
database.<br>
Just fill in the fields in the form below, and you will get a
confirmation e-mail when it is
all done.<br>
<PRE><!-- Start of FORM -->
<form method="POST" action="http://enrolling.mybes thost.com/enrol.php">
Name: <input type="text" name="Name" Size="50"><br>
First Name(s): <input type="text" name="FirstName s" Size="60"><br>
Date of Birth: <input type="text" name="DOB" value=""> (YYYY-MM-DD)<br>
Sex: <select name="Sex">
<option value="Female"> Female
<option value="Male">Ma le
</select><br>
Address: <input type="text" name="Address" Size="70"><br>
Town: <input type="text" name="Town" Size="40"><br>
County: <input type="text" name="County" Size="15"><br>
Postcode: <input type="text" name="Postcode" Size="15"><br>
Telephone: <input type="text" name="Telephone " Size="30"><br>
Mobile: <input type="text" name="Mobile" Size="30"><br>
Fax: <input type="text" name="Fax" Size="30"><br>
E-mail: <input type="text" name="E-mail" Size="70"><br>
Course: <input type="checkbox" name="Course" value="Piano"> Piano<br>
<input type="checkbox" name="Course" value="Keyboard ">
Keyboard<br>
<input type="checkbox" name="Course" value="Singing" > Singing<br>
<input type="checkbox" name="Course" value="Other"> Other<br>
(If "Other", please specify:)<br>
<input type="text" name="OtherCour se" Size="60"><br>
Session: <select name="SessionTy pe">
<option value="1 hour"> 1 hour
<option value="30 minutes"> 30 minutes
<option value="5 trial 1 hour"> 5 trial lessons @ 1 hour
<option value="5 trial 30 minutes"> 5 trial lessons @ 30 minutes
<option value="Other"> Other
</select><br>
(If "Other", please specify :)<br>
<input type="text" name="OtherDura tion" Size="40"><br>
No of students:<input type="text" name="NumberOfS tudents" Size="4"><br>
<input type="submit"> <input type="reset">
</form>
<!-- End of FORM --></pre>
<body>
</html>

In order not to be a pain, I will ask about the other issues later and
try to get this one sorted first.
All help will be much appreciated.
Aug 17 '05 #1
3 1295
>Everything is beginning to work, but there are still a few issues left.
Please forgive my ignorance and hence stupid questions (Newbie).
I can now enter data with no problem, I get no errors, however, when I
check the contents of my DB, 2 fields display nothing.
The Fields PostCode (VARCHAR(10)) NOT NULL and
Email (VARCHAR(80)) NOT NULL
both remain empty in the database although I have entered data.
'' is a valid content of a VARCHAR(10) field.

You have no input field for 'PostCode' in your form.
You have no input field for 'Email' in your form.
Like I said, I get no error messages after completion of the form.
If it helps, here is the PHP file to enter everything:


Add the statement:
echo $query;
right before the call to mysql_query. Show us what it prints
when it does something you think is wrong. This will separate
MySQL issues vs. PHP and HTML issues.

Gordon L. Burditt
Aug 17 '05 #2
Gordon Burditt wrote:
'' is a valid content of a VARCHAR(10) field.

You have no input field for 'PostCode' in your form.
You have no input field for 'Email' in your form. Managed to miss that somehow.
Fixed it now.
Thanks.
Add the statement:
echo $query;
right before the call to mysql_query. Show us what it prints
when it does something you think is wrong. This will separate
MySQL issues vs. PHP and HTML issues.

Gordon L. Burditt

Here we go for the next one: I have one field with a choice via
checkboxes (where more than 1 choice is possible), I would like to see
all the fields (if users select multiple options of course) filling the
'Course' field, eg. if someone selects as their course Piano and also
Singing, I would like to see in my DB in the 'Course' field something
like "Piano, Singing".
I am not really sure where I am going wrong here.
The data type for this field is VARCHAR.

Thanks,
Newsscanner.

Aug 17 '05 #3
Newsscanner wrote:
Here we go for the next one: I have one field with a choice via
checkboxes (where more than 1 choice is possible), I would like to see
all the fields (if users select multiple options of course) filling the
'Course' field, eg. if someone selects as their course Piano and also
Singing, I would like to see in my DB in the 'Course' field something
like "Piano, Singing".


Here's an article with example on using PHP to accept input from form
fields that have multiple values:
http://www.apptools.com/phptools/forms/forms3.php

Once you have them in your PHP code as an array object, use implode() to
make a single comma-separated string out of the elements in the array.
See http://us3.php.net/implode

Then you have a string you can use to insert into your VARCHAR field.

Regards,
Bill K.
Aug 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

34
4131
by: s c o t t | last post by:
I know Jakob Neilsen and a bunch of other usability advocates and critics usually frown on usage frames. However, most people probably seem to have at least version 5 of IE or newer and I am toying with the idea of just using a small topframe in my site design. Do any of you have strong opinions either for or against frames? I personally don't mind sites with them if the borders are hidden and they are well-designed... Thanks,
2
5835
by: Uma Abhyankar | last post by:
Hello, I am using .NET Beta1 Visual Studio. I have to invoke VCBuild through MSBuild on command prompt. I have following issues: Issue1: -------- MSBuild invokes VCBuild internally. However it invokes VCBuild without
1
2077
by: Uma Abhyankar | last post by:
Hello All, I was facing an issue with VCBuild on Beta1. Today after shifting to .NET Beta2, it looks like the issue is still not resolved :-( I have to invoke VCBuild through MSBuild on command prompt. I have following issue: Issue: -------- MSBuild can invoke VCBuild internally. However it invokes VCBuild without
4
11511
by: MLH | last post by:
I am having failures processing the following command and I wonder if you can tell me what I must do in order to have success. When I try to run source mysql_dump.sql.txt ==> it is a problem for me. 1) I put the file in /home/mlh/public_html/credifree/sql_script/. 2) I made that directory my current directory 3) I typed mysql and pressed ENTER 4) I then typed source mysql_dump.sql.txt and pressed ENTER A bunch of error...
5
1845
by: Bill Stock | last post by:
I'm inherited a database that has a few issues. One of the less severe issues, but the one the users bitch about is the speed across the LAN. So I thought that I could unbind the NUMEROUS subforms on the tab control. So I unbound the 25+ subforms and added an OnChange event to the Tab Control. Only about 2/3 of the subforms have reappeared. I've been over the names again and got a few more working, but there are some that just won't come...
687
23611
by: cody | last post by:
no this is no trollposting and please don't get it wrong but iam very curious why people still use C instead of other languages especially C++. i heard people say C++ is slower than C but i can't believe that. in pieces of the application where speed really matters you can still use "normal" functions or even static methods which is basically the same. in C there arent the simplest things present like constants, each struct and enum...
8
2004
by: Brad Simon | last post by:
I have written a shopping cart using ASP .NET (VB). It has been running quite successfully on a site for about a year or so. I use the SessionID as the key to hold information on the shopping cart. I have copy / pasted the code into a new site. Everything is working, EXCEPT for the shopping cart holding the SessionID. I have watched the variable, and each time I hit the 'Update' button in a datalist, the session ID changes. That is...
5
1579
by: R.Kaiser | last post by:
After reading the good news concerning STL/CLI in Orcas C++, the next question is: Does anybody know whether Orcas C++ still uses monolithic header files containing all definitions and declarations, or will there be "real header files" containing only declarations? Richard
2
1468
by: darrel | last post by:
Quick background: Our department reveived new PCs a few weeks ago. Alas, due to new security policies, we weren't immediately set up as admins of our own machines, so most of us developers had issues getting SQL Server and IIS running properly. They apparently fixed all permissions (granting us admin rights) and we thought we were good to go.
0
8995
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9561
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9381
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9332
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8252
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.