OK, I agree with Iceman, but I will be a bit nicer and HELPFUL about it. (Iceman, quit posting if you are going to be such an arrogant prick all of the time. It doesn't help AT ALL)
In these statements, you need to clarify the WHERE clauses. Is $description a stirng that reads "description = 'nothing'"? The bottom line is this. As it stands, with what you posted, your WHERE clauses don't do anything for your SELECT queries.
$itemnamev=mysql_query("select * from items where $itemname", $db);
$descriptionv=mysql_query("select * from items where $description", $db);
$picturev=mysql_query("select * from items where $picture", $db);
They should probably read something like:
$itemnamev=mysql_query("select * from items where itemname = '$itemname'", $db);
$descriptionv=mysql_query("select * from items where description = '$description'", $db);
$picturev=mysql_query("select * from items where picture = '$picture'", $db);
In this mess here, you have 4 loops, but are only closing off 2 of them.
<?php
// First one open
while($data = mysql_fetch_array($itemnamev)) {
// Second one open
foreach($data as $one_field) {
echo "<tr><td> $one_field</td>";
//Third one open
while($data = mysql_fetch_array($descriptionv)) {
// Fourth one open
foreach($data as $one_field) {
echo "<td>$one_field</td></tr>";
// These would only close off the first 2 loops. You still need to
// Close off the last two, and you need to do it right for the loops
// to work right.
}
}
?>
Like I said earlier though, Iceman is right about the fact that your code is a bit sloppy. You should always make a habit (especially when looping results and nesting loops) to indent each loop+1 for every loop.
This does 3 things:
1) Makes it easier for you to debug yourself.
and
2) Makes it easier for others to help you out.
and
3) keeps you from getting IceMan styled posts thrown at you.