Click to See Complete Forum and Search --> : mysql_query variable.


Dragonkai
11-13-2007, 03:38 AM
Is it possible to have this and work?


mysql_query($query)
or die(mysql_error());


mysql_query($secondquery)
or die(mysql_error());


$query = "UPDATE " . "test" . " SET " . $columntype[$j] . " = '" .
"1" . "' WHERE id =
'" . $i . "'";

$secondquery = "UPDATE " . "test" . " SET " . $columntype[$j] . " = '" .
"0" . "' WHERE id =
'" . $i . "'";

Thanks in advance, it's just I haven't seen it written like this anywhere.

stephan.gerlach
11-13-2007, 04:55 AM
This wouldn't work because you run the query befor you have said what the query is. But this should work.






$query = "UPDATE " . "test" . " SET " . $columntype[$j] . " = '" .
"1" . "' WHERE id =
'" . $i . "'";

$secondquery = "UPDATE " . "test" . " SET " . $columntype[$j] . " = '" .
"0" . "' WHERE id =
'" . $i . "'";


mysql_query($query)
or die(mysql_error());


mysql_query($secondquery)
or die(mysql_error());

Dragonkai
11-13-2007, 08:03 PM
Thanks!