Try the following…
[php]$sql=“UPDATE parts
SET
part_number
=$number,
part_description
= ‘$description’,
part_datasheet
= ‘$datasheet’,
part_a
= ‘$a’,
part_b
= ‘$b’,
part_c
= ‘$c’,
part_d
= ‘$d’,
part_e
= ‘$e’,
part_f
= ‘$f’,
part_g
= ‘$g’,
part_p
= ‘$p’,
part_shape
= ‘$shape’,
part_cabledia
= ‘$cabledia’,
part_imped25
= ‘$imped25’,
part_imped100
= ‘$imped100’,
part_cat
= ‘$cat’,
part_family
= ‘$family’,
part_manufacturer
= ‘$manufacturer’,
Part_website
= ‘$website’,
part_website2
= ‘$website2’,
part_rosh
= ‘$rosh’,
part_image
= ‘$image’
WHERE part_id
= $pid”;[/php]
There are a few subtle changes yo umight not see. First the “*” has to go (I am sure you got that from the classic “SELECT * FROM …” - in UPDATE you are just telling it to update a specific field.
The next changes are the quotes. The nice thing about PHP (or bad depending on perspective) is it is a lazy language. I do not know how your DB is set up initially, so I took a guess. But if you have your part_number and part_id set as"int"(or integer) you should not have a single quote. so rule of thumb: varchar, text etc… DO QUOTE the variable, otherwise DO NOT QUOTE the variable.
It is also good practice to have all fields set with a “reverse” quote (upper left key on below “esc” key).
Another good practice, as Ernie pointed out, is to always include a error trap on your queries. In your example I do something like this.
[php]$query = mysql_query($sql) or die(“Bad Query String:
$sql
”.mysql_error());[/php]
This is the reason I break it up into 2 sections. MySQL is horrible at telling you what is wrong, so sometimes seeing your sql string in action, will make a light go on.
Hope this helps.
ps
final note, for readability, it would not hurt to format your sql strings as shown above. This way when you go back, your not scrolling all over your page, and you can quickly see what you are doing.