I am using mssql and php, so i trying to get the query result when the user enters the query and submits the execute button.
i want to differentiate the syntactically correct query and the incorrect query with different colors.
here i am posting my code for retreving the query
Code: Select all
if (-1 == $connection)
$result = mssql_query($query);
else
$result = mssql_query($query, $connection);
if (!$result) {
print "<p style=\"color:red;\">MS-SQL-Fehler: ".mssql_get_last_message()."</p>\n";
$error=1; //my changes}when displaying i am writing like this
Code: Select all
foreach($_SESSION['history'] as $item) {
$item = str_replace(";","",$item);
if(error==0)
echo "<option >$item</option>";
else
echo "<option style=\"color: red;\">$item</option>";feyd | Please review how to post code using
Code: Select all
andCode: Select all
tags. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]