Re: MySQL error stops page rendering
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Mon, 02 Apr 2007 14:48:03 -0400
Justin.Voelker wrote:
On Apr 2, 1:16 pm, Jerry Stuckle <jstuck...@xxxxxxxxxxxxx> wrote:Justin.Voelker wrote:Can anyone clue me on on how to have my html page continue renderingThat depends. Why is the page stopping? A mysql error won't stop the
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!
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...@xxxxxxxxxxxxx
==================
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.
jstucklex@xxxxxxxxxxxxx
==================
.
- Follow-Ups:
- Re: MySQL error stops page rendering
- From: Justin Voelker
- Re: MySQL error stops page rendering
- References:
- MySQL error stops page rendering
- From: Justin.Voelker
- Re: MySQL error stops page rendering
- From: Jerry Stuckle
- Re: MySQL error stops page rendering
- From: Justin.Voelker
- MySQL error stops page rendering
- Prev by Date: Re: Access private props through ancestor
- Next by Date: Re: Status page
- Previous by thread: Re: MySQL error stops page rendering
- Next by thread: Re: MySQL error stops page rendering
- Index(es):
Relevant Pages
|