
May 8th, 2000, 09:50 AM
|
|
Junior Member
|
|
Join Date: Apr 2000
Posts: 4
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I see now that my example was not very clear. My sql statement was correct...
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
/* select items from table */
$sql = "SELECT *
FROM Table
WHERE ID = '$ID'";
/* execute sql query and get result */
$sql_result = mysql_query($sql, $connection) or die ("Couldn't execute query.");
/* format results by row */
while($row = mysql_fetch_array($sql_result)) {
$item1 = $row["item1"];
$item2 = $row["item2"];
};
[/code]
but my table example was misleading. A better representation of what my table needs to look like is:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<TR>
<TD>item1 item2</TD><TD>item1 item2</TD><TD>item1 item2</TD>
</TR>
<TR>
<TD>item1 item2</TD><TD>item1 item2</TD><TD>item1 item2</TD>
</TR>
[/code]
Each table cell should show a different instance of data pulled from the fields item1 and item2.
For example: If item1 is a persons First name, and item2 is the Last name, I could have a 3(columns) by 2(rows) table with different names in each cell.
|