473,385 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1948
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ashish Gupta | last post by:
Dear Mysql-help, I am new to mysql server and trying to install the mysql server on my windows xp home edition. I have downloaded 4.0.14 zip file on my computer. I can unzip the file and it...
21
by: Eugene | last post by:
Hi.... I have a little javascript popup box that people click on to open up an information panel. I made some little blinking star anims on the page that stop blinking after the popup has...
4
by: Jeff S | last post by:
To make a long story short, let me say I had MySQL working on Windows 98 and everything was fine. Well, I took the big leap and removed all traces of Windows and Microsoft from the computer....
6
by: MBS | last post by:
Yeah, read the previous posts...I did that. None answer my question. I just installed PHP 5.0.4, Apache 2.0.54, and MySQL 4.1.13 a few days ago on WinXP SP2. My goal is to learn to use these...
6
by: José Joye | last post by:
Hello, I'm currently reading the MS Developing Web applications with c# (and VB.net). In the chapter related to Error management, there is a sample about "Page-Level Error Pages" eg: In my...
1
by: jlee | last post by:
I'm pretty much a newbie on mysql, and I need some help. I am running mysql Ver 12.22 Distrib 4.0.24, for portbld-freebsd5.4 (i386) on a server hosting an active website. The site's developer...
4
by: Richard | last post by:
Hi All, I've been trying to build a Ruby-on-Rails plus MySQL application. I'm running Ruby 1.8.2, Rails 1.1.4 and MySQL 5.0.15-nt over WinXP-Pro/SP2. I run under an Administrative account. ...
7
by: eholz1 | last post by:
Hello Group, Perhaps you can help me. I have a mysql db, that holds images. Images are encoded using base64_decode/encode, etc. Image data seems fine. I have a view.php page that is supposed...
10
by: DavidPr | last post by:
I'm having a problem putting entries into a table. I have a job board and I want to prevent certain companies from being able to register - again. I don't allow certain type ads, so when they...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.