Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $servername = "localhost";
- $username = "root";
- $password = "********";
- $database = "TABLE2016";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $database);
- $sql = "INSERT INTO TEMPOTABLETOCALC (NAME, VALUE)
- SELECT T2.NAME, T2.VALUE
- FROM TEAM2 as T2
- INNER JOIN TEAM1 as T1 ON T1.NAME = T2.NAME
- WHERE T2.VALUE < T1.VALUE
- mysql_select_db($database);
- $sqlquery = "SELECT * FROM TEMPOTABLETOCALC";
- $resultofquery = mysql_query(sqlquery);
- echo "<table>";
- while($row=mysql_fetch_array($resultofquery)){
- echo "<tr><td>" . $row['stockcode'] . "</td><td>" . $row['age'] ."</td></tr>";
- }
- echo "</table>";
- mysql_close();
- Result
- +--------+-------+
- | NAME | VALUE |
- +--------+-------+
- | APPLE | 4 |
- | PEAR | 9 |
- +--------+-------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement