How to echo all rows with all columns?

Can I echo all rows ? here’s what my script is:

$options=mysql_query("SELECT col1, col2, col3, col4 FROM table1");
while($allrowsandcolumns=mysql_fetch_array($options)) { 
$options1=mysql_query("SELECT * FROM table2 where id=$allrowsandcolumns");
} 
while($rows=mysql_fetch_array($options1)) { 
echo $rows['name'];
}

My Error says Notice : Array to string conversion in line 3 of code above

IM guessing its because this is not how you display all columns & rows …


Source: sql

Leave a Reply