I need help with PHP basic syntax, I'm really new to the language.
I'm trying to fetch data from MySQL, as you can see, 1 table 6 columns and 2 rows.
+------+--------+--------+--------+-------+-----+
| first |second | third | fourth | fifth | sixth |
+------+--------+--------+--------+-------+-----+
| A1 | B1 | C1 | D1 | E1 | F1 |
| A2 | B2 | C2 | D2 | E2 | F2 |
+------+--------+--------+--------+-------+-----+
my php file code
<?php
define('HOST','irrelevant');
define('USERNAME','irrelevant');
define('PASSWORD','irrelevant');
define('DB','irrelevant');
$con = mysqli_connect(HOST,USERNAME,PASSWORD,DB) or die('Unable to connect');
$sql = "select * from orders";
$res = mysqli_query($con,$sql);
//while($row = mysqli_fetch_array($res)){
//array_push($result,array($row[0],$row[1],$row[2],$row[3],$row[4],$row[5]));
//}
mysqli_close($con);
?>
All I need here is this output which is 1 array with a count(array)=2
{A1 <br> B1 <br> C1 <br> D1 <br> E1 <br> F1 , A2 <br> B2 <br> C2 <br> D2 <br> E2 <br> F2}
without the <'br'> command between them all it should look like this
{A1 <br'> B1 <br'> C1 <br'> D1 <br'> E1 <br'> F1 , A2 <br'> B2 <br'> C2 <br'> D2 <br'> E2 <br'> F2}
in other words, I need it to turn into an array that has just 2 strings in it (the number of rows that currently exist in the table).
This is probably very easy to someone who knows php good, if id'e need to implement this in java it would take me a minute but, damn this php and all these dollars!
thanks in advance