I think you're confusing some equations here.
The energy of a photon E is given by the equation
E = hν
and, the relationship between speed, wavelength and frequency of light is:
c = λν
The energy of a particle with mass can be derived from these particles as follows:
Special relativity tells us that E = pc for particles with no rest mass. Therefore, since photons have no rest mass, we can rearrange this equation to find the momentum (p) of a photon:
p = E/c
Since E = hν and c = λν, we can rearrange to write the formula:
p = h/λ
which gives the momentum of a photon. Conversely, we can solve for wavelength:
λ = h/p
and find an expression of the wavelength of a particle with mass.