Can anyone tell me if there is a better way of turning the row from the table into vaiables. I tried the list($blah,$blah) = mysql_fetch_row($result); way but didnt seem to work. Any ideas?
<?php
require("func_connect.php");
connect ("localhost","tantrum");
session_start();
$sql = "SELECT * FROM company, products WHERE company.cid='1' AND products.cid='1'";
$result = mysql_query($sql) or die("Could not execute query.");
echo "<h1>$name</h1>";
while ($data = mysql_fetch_array($result)) {
do {
// turn all fields in the db into variables
$name = $data["name"];
$cid = $data["cid"];
$id = $data["id"];
$title = $data["title"];
$img = $data["thumbnail"];
echo "<a href=\"view_product.php?id=$id\">$title</a><br>
<a href=\"update_product.php?id=$id\">Update product info</a> :
<a href=\"delete_product.php?id=$id\">Delete product</a><br><br>";
} while ($data = mysql_fetch_array($result));
}
mysql_free_result($result);
?>