I have a query:
$servers_query = "SELECT * FROM servers";
which i grab the result in a variable:
$servers_result = mysql_query($servers_query);
then I put the result into an array:
$arrserver = mysql_fetch_assoc($servers_result);
and try to print using foreach:
foreach ($arrserver as $row)
{
echo $row;
}
However no matter what i do i keeping only the first row of data?
1Server1010 Ext System999.99
Despite the structure of the database being:
+----+-------------+---------------+--------+
| id | productname | description | price |
+----+-------------+---------------+--------+
| 1 | Server10 | 10 Ext System | 999.99 |
| 2 | Server20 | 10 Ext System | 999.99 |
| 3 | Server20 | 10 Ext System | 999.99 |
+----+-------------+---------------+--------+
Aslo if i do
echo $row['productname'];
I seem to alway only get the first character of each feild of row 1 only.
Can anyone help - I am new to this!!
MoMoZoNe
$servers_query = "SELECT * FROM servers";
which i grab the result in a variable:
$servers_result = mysql_query($servers_query);
then I put the result into an array:
$arrserver = mysql_fetch_assoc($servers_result);
and try to print using foreach:
foreach ($arrserver as $row)
{
echo $row;
}
However no matter what i do i keeping only the first row of data?
1Server1010 Ext System999.99
Despite the structure of the database being:
+----+-------------+---------------+--------+
| id | productname | description | price |
+----+-------------+---------------+--------+
| 1 | Server10 | 10 Ext System | 999.99 |
| 2 | Server20 | 10 Ext System | 999.99 |
| 3 | Server20 | 10 Ext System | 999.99 |
+----+-------------+---------------+--------+
Aslo if i do
echo $row['productname'];
I seem to alway only get the first character of each feild of row 1 only.
Can anyone help - I am new to this!!
MoMoZoNe