Link to home
Start Free TrialLog in
Avatar of pingeyeg
pingeyeg

asked on

Equivalent to err.number in php

What is the equivalent to err.number in php?
Avatar of Cornelia Yoder
Cornelia Yoder
Flag of United States of America image

Tell me what is err.number and what does it do, and I'll tell you what it is in php :))
Avatar of pingeyeg
pingeyeg

ASKER

In ASP it is used in if...then statements.  For instance I have this block of code and I am trying to change it into PHP, but I don't know what the equivalent is in PHP.

If Err.Number <> 0 Then
         
            strValid = "<p align=center><font face="Verdana" size="2" color="#F0000"><b>"
                       "Sorry!</font></b><font face="Verdana" size="2" color="#000080"> This informatino has already been added.</font><br>"
                       "<br><font face="Verdana" size="2" color="#000080">Please choose a different <b>E-Mail Address</b> and <b>Password.</b></br>"
                       "</font></p>"
        else
                        strValid = "<p align="left"><b><font face="Verdana" size="2" color="#008080">Provider's information has been added successfully!</b></font>"
Avatar of b0lsc0tt
What type of error?  Since some of the previous questions have been about MySQL I will assume that is what you want to check and report.

mysql_errno() returns the number for the error message.

mysql_error() returns the error message.

Each funtion takes the "identifier" as the argument in the function.

Let me know if I misunderstood or you need details.

bol
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
So what triggers err.number to be non-zero?
I also refer to my comments in your question you closed some minutes ago:
you seem to be learning php. if that is the case, do so.
if you are just trying to translate .asp into .php without reviewing the code and eventually improving it (with the power php can give you), you are doing a nonsense job.
What do you mean by a nonsense job?
I am slowly learning php right now.  I am in the middle of switching hosting companies to a Unix based server so I will be using PHP.  I know ASP very well, but the code is a bit differnent and I am just trying to convert myself over to the different language.  Right now I don't have a lot of time to research piece by piece to translate.  Once I finish the translation I will seriously dig deeper to learn this stuff.
why would you just translate working asp pages into php?

if you want to learn php, learn php. do not try to learn it by translating from any other language, as you will miss the powers of php.
I do not speak about general algorythms, they remain the same.
I'm switching over to this language because of it being so powerful.  I just happen to switch at a bad time in the production of this site so I am pressed for time in learning it until I get done what I need to get done.  
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I see what you mean and I am learning as we speak.  It doesn't hurt though to get a good kick in the right direction.
good luck :-)

note that I do often write syntax errors in all the languages I write, as I often confuse them:
VB 6
VB.Net
C#
php
asp
asp.net
SQL Server
MySQL
Oracle
Access
and some others...


in regards to your project(s), you might want to get some tools:
http://www.freedownloadscenter.com/Best/php-html-parser.html