[PHP-DB] How to do an update with arithmetic from a user input

2004-08-12 Thread Chip Wiegand
I have an existing database and web page showing the query results. I have added another field to allow a user to input a two digit number. I want that number to change the number in one of the existing columns for the item it was input next to. I have these columns - Part Number

Re: [PHP-DB] How to do an update with arithmetic from a user input

2004-08-12 Thread Justin Patrin
On Thu, 12 Aug 2004 12:46:19 -0700, Chip Wiegand [EMAIL PROTECTED] wrote: I have an existing database and web page showing the query results. I have added another field to allow a user to input a two digit number. I want that number to change the number in one of the existing columns for the

Re: [PHP-DB] How to do an update with arithmetic from a user input

2004-08-12 Thread Chip Wiegand
Justin Patrin [EMAIL PROTECTED] wrote on 08/12/2004 12:55:24 PM: On Thu, 12 Aug 2004 12:46:19 -0700, Chip Wiegand [EMAIL PROTECTED] wrote: I have an existing database and web page showing the query results. I have added another field to allow a user to input a two digit number. I want

Re: [PHP-DB] How to do an update with arithmetic from a user input

2004-08-12 Thread Justin Patrin
Unless $part_number is a number, you're going to want to put quotes around it. Well, actually, you want to run mysql_real_escape_string() on it. You also don't seem to have an end to that if statement. Usually, people use curly braces around those: if(true) { //do something } - Original

Re: [PHP-DB] How to do an update with arithmetic from a user input

2004-08-12 Thread Chip Wiegand
Justin Patrin [EMAIL PROTECTED] wrote on 08/12/2004 01:37:35 PM: Unless $part_number is a number, you're going to want to put quotes around it. Well, actually, you want to run mysql_real_escape_string() on it. You also don't seem to have an end to that if statement. Usually, people use

Re: [PHP-DB] How to do an update with arithmetic from a user input

2004-08-12 Thread Justin Patrin
You don't need the colon as well as the curly brace on your if. Again: if (isset($submit)) { //do stuff } Your update query doesn't say anything about the description, I don't see how it could eb affected. Also, looks like you're using register_globals. Check out this page and the links for