|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Update SQL query
Just a quick question. I have the following SQL query which updates the game covers in the database. However, I want it to see if a value has been entered, and if not, leave the current database entry as it is. Is there any value I could set into the variables $filename[1] and $filename[2] which'll leave the current database entries as they are? I cant really remove them from the query so Ideally Id like to do it this way.
Thanks for your help. PHP Code:
|
|
#2
|
||||
|
||||
|
The only way would be to do a select statement against the db.
__________________
Environmental LIMS What the hell is all this LIMS st*ff about? --------------------------------------- PHP Pagination Function PHP Drop Down Menus |
|
#3
|
||||
|
||||
|
Right, ok, thats what I figured. I just wanted to check there wasnt some SQL code that just added the original entry back to the database.
|
|
#4
|
|||||
|
|||||
|
Here is an example, you may have to modify for your specific needs as you have not shown any data and I may be misinterpreting.
Say your U.S. mag can have any of a number of colors. If it is red you want to change it to orange, if it is blue you want to change it to green, if it is any other color you want to leave it as is. sql Code:
note there are no commas or anything needed within the case statement.
__________________
MySQL - reformat varchar dates to proper date type || MySQL - room vacancies || output results with column names with mysql only Latest row per group || Deleting duplicates || Gaps in auto increment column My site: sql help articles |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Update SQL query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|