justsomeguy Posted August 13, 2019 Share Posted August 13, 2019 What do you mean check and store the email that was removed from posting? All you're doing is trying to list the records that are in a table. Do you mean you want to skip records that have an email address that you blocked or something, so that existing posts in your database that were made with that email no longer appear? Link to comment Share on other sites More sharing options...
Html Posted August 14, 2019 Author Share Posted August 14, 2019 The point in this is to get the email restricted. Where is the email going to be stored? In the email table. So the forum form will validate that the email can't be used. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 14, 2019 Share Posted August 14, 2019 And you want to validate the email, when, when you display existing posts? Wouldn't it make more sense to do that when someone creates a post so that you don't allow them to create it in the first place? I'm trying to figure out why you're doing anything at all on a page which displays data from the database instead of the pages that add the data to the database. This is still aside from the fact that thee code you showed is not even getting the forum posts at all, it's only getting the email list and that's all. Link to comment Share on other sites More sharing options...
dsonesuk Posted August 14, 2019 Share Posted August 14, 2019 1) everytime someone provide email, it should be added to email table ONLY if it does not exist already. 2)when a post is made It should check if email exists and its blocked status, IF blocked do not process else continue to process. Link to comment Share on other sites More sharing options...
Html Posted August 14, 2019 Author Share Posted August 14, 2019 ^ Right okay, I want something like that. Using the code I have supplied, i want to add to it. So what do I do? Link to comment Share on other sites More sharing options...
dsonesuk Posted August 14, 2019 Share Posted August 14, 2019 (edited) Do it one step at a time in separate php page. 1)inserting email if it does not exist Select query where email = email supplied, use count of rows, if greater than zero it exists, no need to add to email table. Else INSERT query to add into email table. 2) validate block status use SELECT query to get blocked status of current email provided if true stop/end/terminate, else store, show whatever. Edited August 14, 2019 by dsonesuk Link to comment Share on other sites More sharing options...
Html Posted August 14, 2019 Author Share Posted August 14, 2019 I don't know what to do get the result. I thought that by having the code Select from email, using the the other option, what ever it is called now, I don't remember, on the previous page, https://www.w3schools.com/sql/func_mysql_isnull.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now