Thomas Nyman wrote:
I found an instruction on the net concerning "Date Arithmetic" and which seems to be exactly what I need to hel me get going..however there seems to be either a mistake on my behalf or on the writers behalf.

Can anyone say whats wrong with this query

$query2="UPDATE KK_Fatalie SET datum = DATE_ADD(date,INTERVAL intervall'
''.$typeArray[$row->type].")WHERE kk_ID="".$row->kk_ID"";

The query is suppose to result in the following;

do an UPDATE on table KK_Fatalie and set the column datum equal to todays date increased with the interval stated in the column intervall where the kolumn kk_ID equals the kk_ID in my earlier php query.

You appear to have some syntax errors in your PHP (too many quote marks, and they're mismatched in some places). You also don't tell us the exact MySQL error message, and it's not obvious based on your $query2 line what all problems are without more knowledge about your table structure.


Try printing out your $query2 string to the web page where you're running this query. Then enter the query using the interactive mysql program and seeing what error message MySQL produces.

You could also edit your mysql_query() call to do something like:

$rid2 = mysql_query($query2);
if(! $rid2)
echo "Error in query! Error: ".mysql_errno().": ".htmlspecialchars(mysql_error())."<br>\n";


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to