On my site,
I have textbox
where user enters URL.
Onece user enters it I show preview of that url, which contains image on that url and small description.
I fetch preview details from database.
Scenario is like this:
1. user enters url
2. Check whether url exist in table
3. If yes dont inset into db and fetch details like url title, desc, image
4. If not exist insert into table and then show the preview from it
So how first I can check whether it is present in table or not?
I have $url
to check the condition.
select url from post_record where url='".$url."';
I want bool or 1/0 result for this query. How can I get it? If True then I directly fetch record if result is 0 then I first enter the details and then show preview from table.
Is this correct way or better scenario someone can think.