Hey guys quick question, I currently have an insert statement
$query= "INSERT into new_mail VALUES ('$to1', '0')"; where fields are username, and message_number
Currently what I would do to check if the entry exists, is do a select query then check the number of rows with mysql_num_rows (php). If rows==1 then I get the current message_number and set it equal to
$row['message_number']+1.
Sonra başka bir sorgu ile bu girdiyi güncelleyin.
Sadece tek bir sorgu ile sadece mysql tüm bunu yapmak için daha kolay bir yolu (eğer varsa eklemek değilse yani 1 ile message_number, artış güncellemek durumunda, çek) var mı?