mysql arithmetic operators using sql command

mysql arithmetic operators using sql command

mysql-arithmetic-operators.php


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>mysql arithmetic operators using sql command</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="Author" content="Md Iqbal Hosan">
  <meta name="title" content="mysql arithmetic operators using sql command">
  <meta name="keywords" content="php, example, code, table, sql command, sql, mysql arithmetic operators">
  <meta name="description" content="mysql arithmetic operators using sql command">
  <style>
   h2, h4{background:#eee; color:#000089;}
   h2{ padding:3px; margin:3px; font-size:22px;}
   h4{ padding:2px; margin:2px; font-size:19px;}
   p{padding:2px; margin:2px; color:#0099FD;}
   body{ background:#FFFFFC;}
  </style>
 </head>
 <body>
  <h2>mysql arithmetic operators using sql command</h2>
  <pre>
   <?php
    /*
     --------------------------------------------------------------------------------
     WE WANT TO SELECT FirstName, LastName, MonthlySalary and a bonus of 700 of all
     employees of the HR database by using sql command
     --------------------------------------------------------------------------------
    */
    $sql = " SELECT FirstName, LastName, MonthlySalary, MonthlySalary + 700 FROM employees ";
    /*
     -------------------------------------------
     you can use this in php. just follow this:
     -------------------------------------------
    */
    
    mysql_connect('localhost', 'root', 'root');
    mysql_select_db('hr');
    mysql_query($sql);
    
    /*
     ---------------------------------------------------------
     provide your own data if you have differ than that of me
     ---------------------------------------------------------
    */
   ?>
  </pre>
 </body>
</html>

mysql arithmetic operators using sql command - output in the client

No comments:

Post a Comment

leave your comments here..