![]() |
PHP again!
I'm hoping someone can help, there's a really obvious problem here but I've stared at it for too long and can't see it! Here the code:
http://www.strzelecki.co.uk/rsvp.phps It's an RSVP script for my wedding website that pull the guests details from a database and allows them to amend them and tell me whether they are coming and then updates the database with this info, normally simple, but it refuses to do the update, I think I've done the loops wrong but a fresh pair of eyes will be able to spot that! For reference the array(s) produced to update the data seem ok Code:
Array |
Re: PHP again!
PHP Code:
---------- Post added at 23:21 ---------- Previous post was at 23:15 ---------- I would have used frm and db prefixes for the form and database variables, to avoid the possibility of confusion, which if the else above is true, would be most likely what has happened. |
Re: PHP again!
Ok I'll give that a try! Although I think if it was that it wouldn't print out the array content as this comes afterwards.
|
Re: PHP again!
Hmmm :scratch: Is there not a built-in result variable :erm: Trying to recall from the last time I wrote PHP - pretty certain you can check the result of the last SQL statement executed.
|
Re: PHP again!
something like
PHP Code:
|
Re: PHP again!
Yeah - looks right. Should also be an error variable I think.
I can always read code, even if I can't write it. It's been a few years since I wrote in PHP - wrote an ecommerce website for a project at Uni. Condom shop. Caused a bit of a stir :D |
Re: PHP again!
:D
Well I think I see a problem, now getting: Code:
Ian4Array |
Re: PHP again!
Now getting :confused:
|
Re: PHP again!
Well
PHP Code:
|
Re: PHP again!
Array output looks ok to me :erm: Is the connection being closed at the end of the script, once all the updates are done?
|
Re: PHP again!
Yeah tried
PHP Code:
and it not having problems pulling the database up twice, just tried PHP Code:
|
Re: PHP again!
If the data is all there and the query is definitely being execute, then I haven't a clue :( One of the PHP gurus on here may have an idea tomorrow - when they're awake.
|
Re: PHP again!
ok, i really appriciate your help! I'll crack this somehow, usually pretty good with PHP but this is so simple!
|
Re: PHP again!
You do know for certain that it's not doing the update - if you view the database outside of PHP, it's not got the data...
|
Re: PHP again!
correct. No update whatso ever. Although you have just given me an idea, swap it for a delete and see if that works!
|
Re: PHP again!
If you change the UPDATE query to a SELECT query, and then output what it's SELECTed, has it selected anything?
Might not be updating because it can't find the row to update - was my thinking [edit] Found what I thought existed - mysql_affected_rows |
Re: PHP again!
Getting somewhere! Changed to a delete and got an mysql_real_escape_string cannot connect error. So delete that and the delete worked. Now put the update back without the mysql_real_escape_string and I'm getting a connection error.
|
Re: PHP again!
So it looks your database gubbins at fault, then
|
| All times are GMT. The time now is 15:55. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum