Hello,
I seem to be having some problems with my site.
I have several tables that store data on items added. If I want to edit an item, it is easy to edit it when the data is in the ‘items’ table, but because I’m using different tables for other parts, it doesn’t seem to like it.
Any ideas ?
UPDATE QUERY
[code=php]
$query = “UPDATE items SET name=’$itemname’, label=’$label’, type=’$type’, stype=’$stype’, qty=’$qty’, uksize=’$uksize’, ussize=’$ussize’, eusize=’$eusize’, colour=’$colour’, condition=’$condition’, material=’$material’, description=’$descr’, rrp=’$rrp’, price=’$price’, pandp=’$pandp’ WHERE id = $id”;
$result = @mysql_query ($query); // Run the Query
SELECT QUERY
[code=php]$query = “SELECT i.id, i.type, i.label, t.id, t.type, l.id, l.name, i.name, i.description, i.price, i.date, s.stype, i.qty, i.uksize, i.colour, c.id, c.colours, i.condition, i.material, i.rrp, con.id, con.condition, m.id, m.material, i.ussize, i.eusize, i.largeimageone, i.pandp, s.id FROM items as i, type as t, label as l, stype as s, colour as c, condition as con, material as m WHERE i.type = t.id AND i.label = l.id AND i.stype = s.id AND i.colour = c.id AND i.condition = con.id AND i.material = m.id AND i.id = $id”;
$result = mysql_query($query); // Run the Query.
if (mysql_num_rows($result) == 1) { // Valid ID, show the form.
// Get the user’s information.
$row = mysql_fetch_array($result, MYSQL_NUM);
SELECT
[code=php]<select name=”type” size=”1″>
<option></option>
‘.”n”;
$type = array(‘footwear’,’clothing’,’mens’,’bargain’,’ladies’,’kids’,’football’,’misc’,’wholesale’,’joblots’);
for($i = 0, $j = count($type); $i < $j; $i++){
echo ‘<option value=”‘.$type[$i].'”‘.(($type[$i] == @$row[4])?’ selected=”selected”‘:”).’>’.$type[$i].'</option>
‘.”n”;
}
echo ‘ </select>
Any help or questions, please fire away.
Many thanks !