Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular

PHPize.online is a free online environment for quickly running, experimenting with and sharing PHP (including Carbon extension for DateTime) and SQL code. You can run your SQL code with PHP code that can use the same DB. For database manipulations you can use pre-defined instances of PDO ($pdo), mysqli ($mysqli) & Laravel query builder ($db)

Copy Format Clear
CREATE TABLE Signage (RecordID int, SignageName varchar(20), DisplayOrder int, SignageImageName varchar(20)); INSERT INTO Signage (RecordID, SignageName, DisplayOrder, SignageImageName) VALUES (3, 'Test 3', 3, 'test3.png'), (1, 'Test 1', 1, 'test1.png'), (2, 'Test 2', 2, 'test2.png'); SELECT * FROM Signage; SELECT RecordID, SignageName, DisplayOrder, SignageImageName FROM Signage ORDER BY DisplayOrder ASC
Copy Clear
Copy Format Clear
<?php $query_fb = " SELECT RecordID, SignageName, DisplayOrder, SignageImageName FROM Signage ORDER BY DisplayOrder ASC "; fb = mysqli_query($mysqli, $query_fb); $ImagePath = "apps/images/"; if (mysqli_num_rows($fb) > 0) { while ($row = mysqli_fetch_assoc($fb)) { ?> <img src="/<?=$ImagePath . $row['SignageImageName']?>" /> <?php } }
Show:  
Copy Clear