My second prob is that I have to check whether a set already exists or not, and then do an update or an insert.
How can I realize this?
Greets
Thanatos
Newbie-Prob2
Moderator: General Moderators
use mysql_affected_rows to see wether data has been altered or not.
*) mysql_affected_rows also returns 0 if the data is exactly the same as before. If these kinds of updates are possible you must do a 'select...' in the if-clause to check wether there are such records or not
Code: Select all
mysql_query($sqlUpdate, $conn) or die(mysql_error());
if (mysql_affected_rows($conn)==0)
// *)
mysql_query($sqlInsert, $conn) or die(mysql_error());