Re: change the font color of a string variable in PHP
| From: | babu | Date: | Fri, 18 Mar 2005 10:08:02 +0000 |
| Subject: | Re: change the font color of a string variable in PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-211027@lists.php.net to get a copy of this message | ||
Hi chris,
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 differ colors.
here i am posting my code
if (-1 == $connection)
$result = mssql_query($query);// or die("Fehler beim Schreiben in die
Datenbank");
else
$result = mssql_query($query, $connection);// or die("Fehler beim Schreiben in
die Datenbank");
if (!$result) {
print "<p style=\"color:red;\">MS-SQL-Fehler:
".mssql_get_last_message()."</p>\n";
$error=1; //my changes}
what i am trying to do is intialising a global variable "$error=0" and changing it to 1 if
error occurs.
when displaying i am writing like this
foreach($_SESSION['history'] as $item) {
$item = str_replace(";","",$item);
if(error==0)
echo "<option >$item</option>";
else
echo "<option style=\"color:
red;\">$item</option>";
but it doe not work can you pls tell me.
Chris Ramsay <raz.net@gmail.com> wrote:Babu,
Check out:
http://www.trans4mind.com/personal_development/StyleSheets/formElements.htm
or google
http://www.google.com/search?hl=en&q=option+text+colour&meta=
HTH
Chris
Send instant messages to your online friends http://uk.messenger.yahoo.com