Byte Forums
»
Computing
»
Programming
»
Web Programming
»
PHP
mysql update where id=$id
|
|
|
mysql update where id=$id
|
|
10-19-2008, 03:52 AM
Post: #1
|
|||
|
|||
|
I am having the worst time coming up with a script to UPDATE a field where a certain id=$id. Someone please help this php newb!
|
|||
|
10-19-2008, 09:18 AM
(This post was last modified: 10-19-2008 09:21 AM by goughy000.)
Post: #2
|
|||
|
|||
|
RE: mysql update where id=$id
PHP Code: <?php![]() Web Hosting | Shoutcast Servers | Custom Solutions |
|||
|
10-19-2008, 03:17 PM
Post: #3
|
|||
|
|||
|
RE: mysql update where id=$id
Assuming that $id variable is going to come from the user possibly, I would sanitize it before going into the database. Also, most times the id is an int (at least in my experience), so you don't need the quotes if the database is expecting an int.
The key to life is sincerity. Once you can fake that, you’ve got it made. - Groucho Marx |
|||
|
10-19-2008, 04:01 PM
Post: #4
|
|||
|
|||
|
RE: mysql update where id=$id
I think that script is going to work... I'm just having a little trouble making it work with my edit repair page page. I am trying to update the status of a field called status by selecting a certain ticket number. Heres the page that shows all the repairs.
PHP Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">I just can't seem to get it to update the status of only one ticket number? Thanks for all the help. |
|||
|
10-19-2008, 04:10 PM
Post: #5
|
|||
|
|||
|
RE: mysql update where id=$id
I don't see an update query anywhere. Unless you don't know where to put it. I assume you want it after the get:
PHP Code: <?phpI assume you want to update the status and not delete it. The key to life is sincerity. Once you can fake that, you’ve got it made. - Groucho Marx |
|||
|
10-21-2008, 01:46 AM
(This post was last modified: 10-21-2008 01:57 AM by slangnit.)
Post: #6
|
|||
|
|||
|
RE: mysql update where id=$id
Problem solved. Thanks for all the help!
PHP Code: if (isset($_GET['ticket_number'])) { |
|||
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads... | |||||
| Thread: | Author | Replies: | Views: | Last Post | |
| PHP MYSQL help please | project_syntax | 11 | 563 |
01-02-2009 05:02 PM Last Post: Josh Connerty |
|
| [Tips]Progogre - PHP (Non-mysql) | progogre | 7 | 284 |
01-22-2008 04:49 PM Last Post: goughy000 |
|
| PHP and MySQL help! | presbyran | 3 | 341 |
08-10-2007 01:26 PM Last Post: Birdie |
|










