ill post a few lines of code, everything before works fine, its just arithmetic with the result of a call to mysql_fetch_row that is strange:
Code: Select all
function test($link_from) {
$r = mysql_query("SELECT COUNT(*) FROM cms WHERE is_active = 1 AND link_from = " .$link_from);
$rows = mysql_fetch_row($r);
die($rows[0]);
die($rows[0]+1);
}
test(1);
ive tried all sorts of variations, typecasting to (int), return the variable and then adding a value, putting $rows[0] in its own variable, etc. ive changed the sql query to count(id), even to "select *" and then used mysql_num_rows($r) and the same result. whats going on, the query works fine, the output is as expected according to the database data, but i cant alter the result??
im baffled...