If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Error message not displaying just blank page

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-06-06, 11:57
jnam jnam is offline
Registered User
 
Join Date: Nov 2006
Posts: 2
Error message not displaying just blank page

Here is my partial code:

if ($dbh) {
#print "it works <br>";
}


my $sql = "SELECT `fname` FROM students WHERE user_id = '$username' ";#SELECT * FROM `location` LIMIT 0 , 30

my $query=$dbh->prepare("$sql");

if (defined($query)) {
$query->execute();
}else {
print "could not execute the query <br>";
}


I need for the error message "could not execute the query <br>"; to display if the $username does not exist, in other words if the db cant be opened.

Right now if the user enters a wrong username the page result is just blank.


Thanks for any help.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On