![]() |
Cannot get data into database
I hope I have put this post in the right section.
I cannot get data into my database This is the script that should update the database: PHP Code:
PHP Code:
Code:
array(15) { ["club_title"]=> string(38) "The Ranch House Country & Western club" ["club_name"]=> string(16) "The John Doe CWC" ["club_type"]=> string(24) "Country and Western Club" ["club_address"]=> string(0) "" ["club_details2"]=> string(0) "" ["club_dance_floor"]=> string(3) "yes" ["club_contact"]=> string(0) "" ["club_open"]=> string(0) "" ["club_admission"]=> string(0) "" ["club_details"]=> string(0) "" ["background_colour"]=> string(7) "#ffffff" ["background_image"]=> string(16) "multi_colour.jpg" ["text_colour"]=> string(7) "#990000" ["header_colour"]=> string(7) "#6633cc" ["action"]=> string(3) "add" }Thanks, |
Let's just look at one part ...
club_title='$club_title' How does $_GET['club_title'] become $club_title ? Can you show us the entire script? Because we must not be seeing it all. |
in your output you have no club code so it doesn't know what to update
|
Quote:
Thank you very much for being so helpful. I can't believe that I've been such a 'dick head' !!!! I couldn't see the wood for the trees. I completely missed: PHP Code:
$club_code is defined at the top of the script: $club_code = "fr1195"; which is generated from: $club_code = "##[club_code]##"; from: PHP Code:
|
Quote:
After the first entry, the user can UPDATE their database entry with their details This is pulled from the database, along with all the other variables: $club_title = $_GET['club_title']; Thank you once again for coming to my rescue. |
Why are you using $_GET? Can't you use $_POST?
|
its from an email link
|
Quote:
I don't know is the simple answer. The truth is that I don't know when to use POST or GET. I would appreciate you advising me. Thank you, |
POST hides all the data sent between pages where GET shows it in the address bar
|
Quote:
1. Is this the only advantage ??? 2. Does it matter ??? Regards, |
POST is the preferred option,
however you cant use POST for links POST is more secure, you wouldn't send a password as GET, also any hidden form fields will be shown in GET too. GET can be altered by the user too |
Quote:
This explains it better for me. One last point: can you give me an example of what you mean "you cant use POST for links". I really do wish I understood things better. Thanks, |
like the address for this thread
http://www.codingforums.com/showthread.php?t=288340 the php for querying the database would be PHP Code:
when posting a form the variables are all hidden therefor cant be in the address bar Code:
http://www.codingforums.com/showthread.php?t=288340 |
Can you show us an example of what one of the links looks like when a person gets an email?
Maybe that will shed some light on this. I missed the part about a confirmation link from an email. But I want to see what that confirmation link looks like. |
Hi Guys...
Thank you very much for helping me. In order to let you know what is happening, here is a link to the index page: http://www.countrymusic.org.uk/clubs...dmin/index.php Here is the resulting email: Code:
Please DO NOT reply to this email. It is an unattended mailbox.This is the page that the above link created: http://www.countrymusic.org.uk/clubs...add_fr1208.php If you do take a look at this, you will see that there is very little information. The user can then fill in the boxes and update the database. After updating the database, the form is returned with all the information filled in that is contained in the database. I did it this way because I don't have to create a special update form. This is as far as I have got. The Review Web Page and Add Dates buttons don't work properly because I haven't managed to get round to coding them to automatically be created with the correct information to display the web page properly. If you want to test it for yourselves, please go ahead. It is still in production so you can't do any harm. Also, this type of project is a first for me, so any advise will be welcome. BTW, I am doing this out of interest, and because I enjoy getting absolutely frustrated doing it. Although I hope the script will be used, I won't receive any reward at all for doing it. Most of the things on my web site are FREE. Thanks. |
| All times are GMT +1. The time now is 09:02 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.