Discussion:
query order issue
dealTek
2013-07-20 16:21:45 UTC
Permalink
Hi all,


I have a page that starts with several mysql sql query searches and displays data below...

then I added a form (with hidden line "do-update" value "UPDATE") on the same page with action to same page...


then above other sql queries - I put...

if ((isset($_POST["do-update"])) && ($_POST["do-update"] == "update")) {

---do update query---

echo '<meta http-equiv="refresh" content="0; url=gohere.php">';

}

but it shows error that happens AFTER the meta http-equiv="refresh" has happened


Catchable fatal error: xxx on line 226



BTW - the meta http-equiv="refresh" does work but the error flashes 1st for a second...

Q: I would have thought that it would not go past the line - meta http-equiv="refresh" - but it does.... any insight on this






--
Thanks,
Dave - DealTek
***@gmail.com
[db-3]
Jim Giner
2013-07-20 17:38:05 UTC
Permalink
Post by dealTek
Hi all,
I have a page that starts with several mysql sql query searches and displays data below...
then I added a form (with hidden line "do-update" value "UPDATE") on the same page with action to same page...
then above other sql queries - I put...
if ((isset($_POST["do-update"])) && ($_POST["do-update"] == "update")) {
---do update query---
echo '<meta http-equiv="refresh" content="0; url=gohere.php">';
}
but it shows error that happens AFTER the meta http-equiv="refresh" has happened
Catchable fatal error: xxx on line 226
BTW - the meta http-equiv="refresh" does work but the error flashes 1st for a second...
Q: I would have thought that it would not go past the line - meta http-equiv="refresh" - but it does.... any insight on this
--
Thanks,
Dave - DealTek
[db-3]
YOu are checking for a value of 'update' but you stated that the value
clause was 'UPDATE'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jim Giner
2013-07-20 17:32:45 UTC
Permalink
Post by dealTek
Hi all,
I have a page that starts with several mysql sql query searches and displays data below...
then I added a form (with hidden line "do-update" value "UPDATE") on the same page with action to same page...
then above other sql queries - I put...
if ((isset($_POST["do-update"])) && ($_POST["do-update"] == "update")) {
---do update query---
echo '<meta http-equiv="refresh" content="0; url=gohere.php">';
}
but it shows error that happens AFTER the meta http-equiv="refresh" has happened
Catchable fatal error: xxx on line 226
BTW - the meta http-equiv="refresh" does work but the error flashes 1st for a second...
Q: I would have thought that it would not go past the line - meta http-equiv="refresh" - but it does.... any insight on this
--
Thanks,
Dave - DealTek
[db-3]
YOu are checking for a value of 'update' but you stated that the value
clause was 'UPDATE'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jim Lucas
2013-07-21 07:37:16 UTC
Permalink
Post by dealTek
Hi all,
I have a page that starts with several mysql sql query searches and displays data below...
then I added a form (with hidden line "do-update" value "UPDATE") on the same page with action to same page...
then above other sql queries - I put...
if ((isset($_POST["do-update"])) && ($_POST["do-update"] == "update")) {
---do update query---
echo '<meta http-equiv="refresh" content="0; url=gohere.php">';
By your description of what you think should be happening in the line
above, my suggestion to would be to look at the header() function in
PHP. It can send a header to the browser that will cause the browser to
stop loading the current page and redirect it to another URL.

http://php.net/header

if ( ... ) {

Do some work...

header('Location: someotherpage.php');
exit();

}

You want to make sure you always call exit(); after issuing a call to
header('Location: ...');
Post by dealTek
}
but it shows error that happens AFTER the meta http-equiv="refresh" has happened
Catchable fatal error: xxx on line 226
BTW - the meta http-equiv="refresh" does work but the error flashes 1st for a second...
Q: I would have thought that it would not go past the line - meta http-equiv="refresh" - but it does.... any insight on this
--
Thanks,
Dave - DealTek
[db-3]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...