Since this is my first post, I'll try to be gentle with you :-)
I have a script that goes like this:
Connect to db. select data from db, and list up (only one variable, text).
I also have a form so I can insert into the database (insert into table where $id = contentid).
How can I check in php, if it is already there?
My code is something like this:
Expand|Select|Wrap|Line Numbers
- $id = intval( mysql_real_escape_string($_GET['id']));
- $as_text = addslashes($_POST['text']);
- $tr_text = trim($as_text);
- $query = "INSERT INTO jos_issues(ID,text,contentid)
- VALUES(NULL,'$tr_text','$id')";
- $result = mysql_query($query);
the table consists of 3 columns; id, text and contentid.
contentid is used so I can list all text that is connected to one particular content.
So, now I've been gentle with you, so you can be gentle with me :-)
Phopman