I'm new to php and mysql. Here's an example of what I'm trying to accomplish.
I have a c_table with 4 columns.
c_id
c_pen
c_catid
c_count
I have two variables:
$penname (this equals the logged in user)
$catid (this equals the category id number)
What I want to happen is this:
If c_pen = $penname AND c_catid = $catid,
Then I'll echo some other variables.
If there isn't a row for that particular penname and catid, then I want to display something along the lines of "you have no entries, click to make one" and it will direct them to my form page to create an entry.
I have tried everything but I can't seem to get any results to check if a row exists or not. Results display just fine if the row exists, but if it doesn't I just get blanks no matter what I do.
How do I check if a row exists and if it doesn't display one thing and if it does display another???