Hi,
This simple code is not working. I’d be grateful for any help.
The [I]if(mysql_query($query))
i’m simply trying to build an input for mysql queries,
[code=php]
$cnx = mysql_connect(‘localhost’, ‘root’, ‘password’);
$db = mysql_select_db(“warmmail”);
if(isset($_POST[‘submit’])) {
$query = $_POST[‘query’];
//echo $query;
if(mysql_query($query)) {
echo “Q succeeded”;
} else {
echo “Q failed”;
echo mysql_error();
}
} else {
echo “<p>Vars not set</p>”;
}
?>
<style type=”text/css”>textarea{width:200px;height:200px}</style>
<form action=”<?php $_SERVER[‘php_self’] ?>” >
<input name=”query” type=”text” />
<input type=”submit” name=”submit” value=”submit” />
</form>
thanks for any help on this!,