MySQL Forums
Forum List  »  PHP

Re: PHP/MySQL Reading Database Field Help!
Posted by: Raymond Jender
Date: July 24, 2019 09:08AM

Peter Brawley Wrote:
-------------------------------------------------------
> If "learn as I go" is to rise above hacking (which
> doesn't deliver reliable results), a systematic
> approach is needed: first write the logical steps
> required by the job, then translate that into
> pseudocode, then translate that into the language
> you're writing.
>
> The pseudocode for your job would be something
> like ..
>
> connect or exit on error
> assemble query
> submit query or exit on error
> check no. of rows returned, if 0 exit
> fetch target row(s)
> examine row values
> ...
>
> As you can see, we don't try to fetch a row till
> we know there's one available.
>
> PHP says $row is an array. Because it's the result
> of fetch_assoc(). But you called that func before
> checking that the row exists.
>
> Re mysqli_num_rows(), check its manual page for
> syntax.

Thanks Peter. I appreciate your help.
You have been a big help. I think I have it figured out
and have what I need.

Thanks,

Ray

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.