So I'm trying to have a relatively simple script. I want to just have one entry in the SQL table and when new information is entered just overwrite that same entry. For the table I have the primary key as the variable ID. I'm not sure how to just extract that one primary key from SQL, I can extract the entire row but then that over writes my new values for $text and $datetime with the ones that are already stored. So I tried just using this code to see if it would properly update and I'm getting an error:
mysql_query("UPDATE pptext SET text='$text', datetime='$datetime' WHERE id='1')",$link) OR DIE(mysql_error());
That returns a SQL syntax error near ')' error. I can't for the life of me figure out where the syntax is wrong. I know everything else is working in SQL because I texted an INSERT INTO statement and it inserted a new row with correct values. Also I'm getting those values from a post form.
If anyone can help me it'd be appreciated. I need help with extracting the id value from the database, rather than me putting the actual id value in there myself. I can extract the entire row but I don't know how to just get that one variable out.
Thanks in advance!