MySQL condition -
I am still new to MySQL and I do not know the best way to do this.
I have a table with payroll values, and if the value is more than a certain limit, then I want to know. So say that I have this table with a current column and the capacity column. A line has increased by user input in current and I want to know that when someone exceeds the value in the existing line or its related capacity get.
If current is still under capacity , then I would like to query the return to the truth
thanks
To check your UPDATE query:
// I believe that you can add existing columns to 1 , //, but this is your table so change the required sub values $ update = mysql_query ('UPDATE table SET current = current + 1 WHERE id ='. Intval ($ row_id). ' Current & lt; capacity '); Then check the mysql_affected_rows () query for UPDATE :
if (mysql_affected_rows ( ) & Gt; 0) {// success}
Comments
Post a Comment