• Notice regarding image hosts and attachments. See here.

php mysql results into an array?

Associate
Joined
19 Jul 2006
Posts
1,847
I think this should be simple but cant find the answer.
I have the following which returns some data.
Code:
<?php 
$result = mysql_query("SELECT col1, col2 FROM table WHERE col1 LIKE 'something%'");
if (!$result) {
    die("Error");
}
I need to use the output to create a table but I need to modify the data returned before putting this in the table.
i though echo $result['col1']; would print the value of col1 but this didn't work.

What I need to do is a table of results in the following format
|some string + value of col1 | col2/10 |

So how do i get back these values to manipulate

TIA
 
Back
Top Bottom