469,962 Members | 2,324 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,962 developers. It's quick & easy.

MySQL error stops page rendering

Can anyone clue me on on how to have my html page continue rendering
past a MySQL error? If you visit www.Base2WebDesign.com, click login,
type in anything for a username and password, then view the page
source. You will see that the page displays the error then just stops
rendering the html. (I know what the error is, I deleted that table
on purpose for a simple way to show you what I would like fixed.)
This doesn't cause any problems on this particular page (other than it
fails vailidation) but I some of my website I have other information
below those errors and even the remainder of the page. If it hits an
error I would like the remainder of the page to still be displayed,
just display the error and keep moving. Is there anyway to do this?
Thank you so much for anyone that can help me out!

Apr 2 '07 #1
6 1797
Justin.Voelker wrote:
Can anyone clue me on on how to have my html page continue rendering
past a MySQL error? If you visit www.Base2WebDesign.com, click login,
type in anything for a username and password, then view the page
source. You will see that the page displays the error then just stops
rendering the html. (I know what the error is, I deleted that table
on purpose for a simple way to show you what I would like fixed.)
This doesn't cause any problems on this particular page (other than it
fails vailidation) but I some of my website I have other information
below those errors and even the remainder of the page. If it hits an
error I would like the remainder of the page to still be displayed,
just display the error and keep moving. Is there anyway to do this?
Thank you so much for anyone that can help me out!
That depends. Why is the page stopping? A mysql error won't stop the
PHP code from running. You must be doing something to make it stop.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 2 '07 #2
On Apr 2, 1:16 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Justin.Voelker wrote:
Can anyone clue me on on how to have my html page continue rendering
past a MySQL error? If you visitwww.Base2WebDesign.com, click login,
type in anything for a username and password, then view the page
source. You will see that the page displays the error then just stops
rendering the html. (I know what the error is, I deleted that table
on purpose for a simple way to show you what I would like fixed.)
This doesn't cause any problems on this particular page (other than it
fails vailidation) but I some of my website I have other information
below those errors and even the remainder of the page. If it hits an
error I would like the remainder of the page to still be displayed,
just display the error and keep moving. Is there anyway to do this?
Thank you so much for anyone that can help me out!

That depends. Why is the page stopping? A mysql error won't stop the
PHP code from running. You must be doing something to make it stop.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Right now my statements are as follows:

$sql = "SELECT
ul_id,ul_username,ul_password,ul_admin_level,ul_lo gin_id FROM
user_login WHERE ul_username='$vul_username'";
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());

Could I change the "or die" part so it would display the message but
continue rendering the page?

Apr 2 '07 #3
Justin.Voelker wrote:
On Apr 2, 1:16 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Justin.Voelker wrote:
>>Can anyone clue me on on how to have my html page continue rendering
past a MySQL error? If you visitwww.Base2WebDesign.com, click login,
type in anything for a username and password, then view the page
source. You will see that the page displays the error then just stops
rendering the html. (I know what the error is, I deleted that table
on purpose for a simple way to show you what I would like fixed.)
This doesn't cause any problems on this particular page (other than it
fails vailidation) but I some of my website I have other information
below those errors and even the remainder of the page. If it hits an
error I would like the remainder of the page to still be displayed,
just display the error and keep moving. Is there anyway to do this?
Thank you so much for anyone that can help me out!
That depends. Why is the page stopping? A mysql error won't stop the
PHP code from running. You must be doing something to make it stop.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

Right now my statements are as follows:

$sql = "SELECT
ul_id,ul_username,ul_password,ul_admin_level,ul_lo gin_id FROM
user_login WHERE ul_username='$vul_username'";
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());

Could I change the "or die" part so it would display the message but
continue rendering the page?
It's doing exactly what you tell it to. You're telling the PHP code to
exit immediately, and it is.

You need to learn how to more gracefully handle errors. mysql_xxx calls
generally return false when they fail. You can test on this and echo an
error message.

How I wish there weren't so many bad tutorials out there!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 2 '07 #4
On Apr 2, 2:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Justin.Voelker wrote:
On Apr 2, 1:16 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Justin.Voelker wrote:
Can anyone clue me on on how to have my html page continue rendering
past a MySQL error? If you visitwww.Base2WebDesign.com, click login,
type in anything for a username and password, then view the page
source. You will see that the page displays the error then just stops
rendering the html. (I know what the error is, I deleted that table
on purpose for a simple way to show you what I would like fixed.)
This doesn't cause any problems on this particular page (other than it
fails vailidation) but I some of my website I have other information
below those errors and even the remainder of the page. If it hits an
error I would like the remainder of the page to still be displayed,
just display the error and keep moving. Is there anyway to do this?
Thank you so much for anyone that can help me out!
That depends. Why is the page stopping? A mysql error won't stop the
PHP code from running. You must be doing something to make it stop.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Right now my statements are as follows:
$sql = "SELECT
ul_id,ul_username,ul_password,ul_admin_level,ul_lo gin_id FROM
user_login WHERE ul_username='$vul_username'";
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
Could I change the "or die" part so it would display the message but
continue rendering the page?

It's doing exactly what you tell it to. You're telling the PHP code to
exit immediately, and it is.

You need to learn how to more gracefully handle errors. mysql_xxx calls
generally return false when they fail. You can test on this and echo an
error message.

How I wish there weren't so many bad tutorials out there!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
I found a few other things to do. Now when there is no result, I call
a function which displays this sort of message...
'mysql_errno($link) . ": " . mysql_error($link);' It's user friendly
and eventually I will build in some logging that will send that info
to a database for future reference (what page they were on, date,
time, etc etc. My question to you is do you know of any other
mysql_xxx($link) functions out there or is it just the error number
and error message?

Apr 2 '07 #5
Justin Voelker wrote:
On Apr 2, 2:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Justin.Voelker wrote:
>>On Apr 2, 1:16 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Justin.Voelker wrote:
Can anyone clue me on on how to have my html page continue rendering
past a MySQL error? If you visitwww.Base2WebDesign.com, click login,
type in anything for a username and password, then view the page
source. You will see that the page displays the error then just stops
rendering the html. (I know what the error is, I deleted that table
on purpose for a simple way to show you what I would like fixed.)
This doesn't cause any problems on this particular page (other than it
fails vailidation) but I some of my website I have other information
below those errors and even the remainder of the page. If it hits an
error I would like the remainder of the page to still be displayed,
just display the error and keep moving. Is there anyway to do this?
Thank you so much for anyone that can help me out!
That depends. Why is the page stopping? A mysql error won't stop the
PHP code from running. You must be doing something to make it stop.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Right now my statements are as follows:
$sql = "SELECT
ul_id,ul_username,ul_password,ul_admin_level,ul_ login_id FROM
user_login WHERE ul_username='$vul_username'";
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
Could I change the "or die" part so it would display the message but
continue rendering the page?
It's doing exactly what you tell it to. You're telling the PHP code to
exit immediately, and it is.

You need to learn how to more gracefully handle errors. mysql_xxx calls
generally return false when they fail. You can test on this and echo an
error message.

How I wish there weren't so many bad tutorials out there!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

I found a few other things to do. Now when there is no result, I call
a function which displays this sort of message...
'mysql_errno($link) . ": " . mysql_error($link);' It's user friendly
and eventually I will build in some logging that will send that info
to a database for future reference (what page they were on, date,
time, etc etc. My question to you is do you know of any other
mysql_xxx($link) functions out there or is it just the error number
and error message?
Nope, just error message and error number. But I've never needed
anything else, either.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 3 '07 #6
On Apr 2, 9:52 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Justin Voelker wrote:
On Apr 2, 2:48 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Justin.Voelker wrote:
On Apr 2, 1:16 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Justin.Voelker wrote:
Can anyone clue me on on how to have my html page continue rendering
past a MySQL error? If you visitwww.Base2WebDesign.com, click login,
type in anything for a username and password, then view the page
source. You will see that the page displays the error then just stops
rendering the html. (I know what the error is, I deleted that table
on purpose for a simple way to show you what I would like fixed.)
This doesn't cause any problems on this particular page (other than it
fails vailidation) but I some of my website I have other information
below those errors and even the remainder of the page. If it hits an
error I would like the remainder of the page to still be displayed,
just display the error and keep moving. Is there anyway to do this?
Thank you so much for anyone that can help me out!
That depends. Why is the page stopping? A mysql error won't stop the
PHP code from running. You must be doing something to make it stop.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Right now my statements are as follows:
$sql = "SELECT
ul_id,ul_username,ul_password,ul_admin_level,ul_l ogin_id FROM
user_login WHERE ul_username='$vul_username'";
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
Could I change the "or die" part so it would display the message but
continue rendering the page?
It's doing exactly what you tell it to. You're telling the PHP code to
exit immediately, and it is.
You need to learn how to more gracefully handle errors. mysql_xxx calls
generally return false when they fail. You can test on this and echo an
error message.
How I wish there weren't so many bad tutorials out there!
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
I found a few other things to do. Now when there is no result, I call
a function which displays this sort of message...
'mysql_errno($link) . ": " . mysql_error($link);' It's user friendly
and eventually I will build in some logging that will send that info
to a database for future reference (what page they were on, date,
time, etc etc. My question to you is do you know of any other
mysql_xxx($link) functions out there or is it just the error number
and error message?

Nope, just error message and error number. But I've never needed
anything else, either.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Thanks for all of your help Jerry. I noticed your name on quite a few
of my posts recently and I want to thank you for all of the wonderful
help and great answers.

Apr 3 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ashish Gupta | last post: by
21 posts views Thread by Eugene | last post: by
4 posts views Thread by Jeff S | last post: by
6 posts views Thread by MBS | last post: by
6 posts views Thread by Josť Joye | last post: by
7 posts views Thread by eholz1 | last post: by
10 posts views Thread by DavidPr | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.