Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old January 17th, 2007, 03:15 AM
user
Guest
 
Posts: n/a
Default showerror() vs mysql_error() ..... difference

Could someone give me the quick difference betweeen the 2 error
functions and why one should use one or the other.



if (!mysql_select_db($database, $connection))
showerror();

$connection = mysql_connect('mysql_host', 'mysql_user', mysql_password')
or die('Could not connect: ' . mysql_error());


TIA
  #2  
Old January 17th, 2007, 06:45 AM
=?iso-8859-1?Q?Kim_Andr=E9_Aker=F8?=
Guest
 
Posts: n/a
Default Re: showerror() vs mysql_error() ..... difference

user wrote:
Quote:
Could someone give me the quick difference betweeen the 2 error
functions and why one should use one or the other.
>
if (!mysql_select_db($database, $connection))
showerror();
>
$connection = mysql_connect('mysql_host', 'mysql_user',
mysql_password') or die('Could not connect: ' . mysql_error());
Since the PHP manual doesn't list a function named showerror(), I can
only guess that it's a user-created function (ie. created by whoever
wrote the script), while mysql_error() is a built-in function that
retrieves the last error message from MySQL (or a blank string if the
last query/access was successful).

--
Kim André Akerø
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
  #3  
Old January 17th, 2007, 06:45 AM
Kimmo Laine
Guest
 
Posts: n/a
Default Re: showerror() vs mysql_error() ..... difference

"user" <someone@someplace.orgwrote in message
news:6ogrh.739663$QZ1.371372@bgtnsc04-news.ops.worldnet.att.net...
Quote:
Could someone give me the quick difference betweeen the 2 error functions
and why one should use one or the other.
>
>
>
if (!mysql_select_db($database, $connection))
showerror();
>
$connection = mysql_connect('mysql_host', 'mysql_user', mysql_password')
or die('Could not connect: ' . mysql_error());

mysql_error is a built-in function, comes in the package, and showerror is
something used only in the php project you are working with. Ask the person
who wrote the script, it's not a common php function. It's possible that it
has more sophisticated error handling than what mysql_error provides.

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
spam@outolempi.net | rot13(xvzzb@bhgbyrzcv.arg)


  #4  
Old January 17th, 2007, 04:35 PM
user
Guest
 
Posts: n/a
Default Re: showerror() vs mysql_error() ..... difference

Thanks to both of you.

Kimmo Laine wrote:
Quote:
"user" <someone@someplace.orgwrote in message
news:6ogrh.739663$QZ1.371372@bgtnsc04-news.ops.worldnet.att.net...
>
Quote:
>>Could someone give me the quick difference betweeen the 2 error functions
>>and why one should use one or the other.
>>
>>
>>
>>if (!mysql_select_db($database, $connection))
>>showerror();
>>
>>$connection = mysql_connect('mysql_host', 'mysql_user', mysql_password')
>>or die('Could not connect: ' . mysql_error());
>
>
>
mysql_error is a built-in function, comes in the package, and showerror is
something used only in the php project you are working with. Ask the person
who wrote the script, it's not a common php function. It's possible that it
has more sophisticated error handling than what mysql_error provides.
>
 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles