Como Atualizar Vários Campos De Uma Tabela Por Formulário
Started By Cleiton Garcia da Silva, 21/12/2009, 19:22
11 replies to this topic
#1
Posted 21/12/2009, 19:22
Aê galera, tenho um site, e tem a página de configurações, criei o SQL, o formulário em fim! Só que tem um problema, não estou sabendo dividir os campos para alterar no MySQL, por ex:
$update = mysql_query("UPDATE tabela_config SET configuracao = '".$configurao."'") or die(erro(mysql_error()));
Como criar vários campos neste código, eu faço assim:
$update = mysql_query("UPDATE tabela_config SET configuracao = '".$configurao."',nome_site= '".$nome_site."',url_do_site = '".$url_do_site."'") or die(erro(mysql_error()));
OBS: os campos que citei acima são ficticios, eu os criei! Então minha pergunta é, como atualizar vários campos de uma tabela por formulário.
Obrigado!
$update = mysql_query("UPDATE tabela_config SET configuracao = '".$configurao."'") or die(erro(mysql_error()));
Como criar vários campos neste código, eu faço assim:
$update = mysql_query("UPDATE tabela_config SET configuracao = '".$configurao."',nome_site= '".$nome_site."',url_do_site = '".$url_do_site."'") or die(erro(mysql_error()));
OBS: os campos que citei acima são ficticios, eu os criei! Então minha pergunta é, como atualizar vários campos de uma tabela por formulário.
Obrigado!
WM Place - O lugar dos webmasters: O melhor lugar onde você encontra, conversa, discute e interage com outros webmasters, assim como você. Acessem: www.wmplace.com.br
#2
Posted 22/12/2009, 07:30
Bom dia amigo.
É como está fazendo mesmo.
Se não está dando certo, poste o erro que retorna no mysql_error();
Uma dica para facilitar é usar o sprintf();
Com ele você separa as variáveis da string e fica mais fácil de ler (Sem esse monte de aspas e pontos).
Abraços e até a próxima.
Mateus
É como está fazendo mesmo.
Se não está dando certo, poste o erro que retorna no mysql_error();
$update = mysql_query("UPDATE tabela_config SET configuracao = '".$configurao."', nome_site= '".$nome_site."', url_do_site = '".$url_do_site."'") or die(mysql_error());
Uma dica para facilitar é usar o sprintf();
Com ele você separa as variáveis da string e fica mais fácil de ler (Sem esse monte de aspas e pontos).
Abraços e até a próxima.
Mateus
#3
Posted 22/12/2009, 07:38
mas é exatamente isso aí cara... a não ser que você queira atualizar apenas 1 registro... aí vc vai ter que criar uma condição... WHERE id = 1, por exemplo!
Se este post lhe ajudou, ajude o fórum também. Use a reputação de mensagens!
#4
Posted 30/12/2009, 12:22
não entendi o que você quer... mas veja se é algo parecido com isso
Será informado N campos ao mesmo tempo ou N campos aleartoriamente e os valores e como identificação desses campos (linha no caso) você envia para essa instrução SQL o ID. certo?
Se for algo assim, você pode fazer com um FOR! mas ai você terá que passar o nome dos campos que serão atualizados e seus valores na mesma ordem =/
T+
Será informado N campos ao mesmo tempo ou N campos aleartoriamente e os valores e como identificação desses campos (linha no caso) você envia para essa instrução SQL o ID. certo?
Se for algo assim, você pode fazer com um FOR! mas ai você terá que passar o nome dos campos que serão atualizados e seus valores na mesma ordem =/
T+
-----------------------------------------------------------------------
PALMEIRAS - Primeiro campeão do mundo em 1951
PALMEIRAS - Primeiro campeão do mundo em 1951
#5
Posted 02/02/2010, 19:23
Obrigado a todos que me ajudaram nisso, thanks!
WM Place - O lugar dos webmasters: O melhor lugar onde você encontra, conversa, discute e interage com outros webmasters, assim como você. Acessem: www.wmplace.com.br
#7
Posted 24/10/2017, 17:00
Dapoxetine Prix Cialis Generic 5mg Viagra Precio Vademecum viagra online prescription Pharmacie Cialis Levitra Generique En France Cialis Discount Generic Zentel Real From Canada Overseas Shop
Will Keflex Cure Pnumonia Propecia While On Ipledge viagra Comprar Cialis Com Need Cialis Today
Will Keflex Cure Pnumonia Propecia While On Ipledge viagra Comprar Cialis Com Need Cialis Today
#8
Posted 25/10/2017, 11:14
Levitra Casero costco pharmacy prices levitra 52 Generic Isotretinoin Pills Best Website Cheapeast Saturday Delivery Viagra Sur Femme
#9
Posted 25/10/2017, 13:13
Discounts! amazing product websites Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked! If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included). READ MORE Kenzo fabric crossbody ( 179.74 $) KenzoStainless Steel Anchor Pendant Necklace ( 105.60 $)65cm retro loft style vintage industrial lighting pendant lights with 6 edison bulb light fixtures , water pipe lamp ( 127.98 $)4b 4c afro kinky curly clip in human hair extensions 7a mongolian african american clip in human extensions for black women ins ( 162.00 $)LED Keychain Light with Screwdrivers Carabiner Wrench Bottle Opener 4.39$Original oukitel k6000 pro 6000mah fdd lte octa core mobile phone 5.5 ( 149.99 $)Online pharmacy Strawson pharmacy with home delivery in Moscow and RussiaVOZDUShNIJ PIROG IZ YaBLOKCHL online store is the official branded merchandise of the Continental Hockey League2016 autumn winter fashion women sheath dress casual blue red black mini dress v-neck ladies diamonds solid dress ( 7.59 $)Black Faux Patent Leather Tote ( 105.00 $)Mitchell, Tomas (aktyor)2016 new cat eye sunglasses women vintage fashion rose gold mirror sun glasses unique flat ladies ( 9.99 $)Indian Virgin Hair Natural Wave 4pcs 7A Indian Curly Virgin Hair Bundles Raw Virgin Indian Curly Hair Weave Natural Indian Hair ( 84.15 $)2x car flexible whiteamber switchback led knight rider strip light for headlight sequential flasher dual color drl turn signal ( 28.14 $)
Discounts! best of beauty awards
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).
READ MORE
Chic colored ball shape pendant knitting design charm bracelet for women ( 4.14 $)
SJCAM M10 Plus Sports Camera DV-103.20 $
Black pop corn pouch ( 166.90 $) Kenzo
Black Quilted Leather Small Flap Crossbody Bag ( 175.00 $)
Kitchen Tomato Slicer ABS Plastic Cutter Slicer Kitchen Gadgets Lemon Orange Fruit Knife Cake Holder Cooking Tool Russian Style ( 2.10 $)
2016 Women Backpack Fashion Leather Shoulder Bags Colorful School Travel Bag for Teenager Girls Backpack Mochila Waterproof ( 23.99 $)
FINOW X5 3G Smartwatch Phone-140.85 $
For Apple iPad Pro 9.7 ( 8.99 $)
Mifree MIP4 1.54 inch Smartwatch Phone-27.58 $
Brazilian full lace human hair wigs with baby hair lace front human hair wigs glueless full lace human hair wigs for black woman ( 102.54 $)
Simple pu leather and colour block design women's sandals ( 33.27 $)
Brutalnij glubokij nokaut v sumo (Video)
1211CM FUNNY SEXY WITCH LADY GIR Sexy Witch Lady Car Stickers Car Sticker Decals BlackSilver CT-585 ( 1.39 $)
Chic rhinestone magnetic bracelet for women ( 3.08 $)
Burnt Orange Leather Nastro Trainers ( 175.00 $)
Discounts! the best new products
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).
READ MORE
5.5 inch blackview e7s smartphone mt6580 quad core 2gb 16gb 1280x720 mobile phone android 6.0 fingerprint 8.0mp unlocked phone ( 69.99 $)
Marrant crazy horse genuine leather bag casual men handbags men crossbody bags men s travel bag ( 98.00 $)
Black leather ankle boot ( 550.99 $) Emilio Pucci
New 7 inch monitor wireless cctv kit 2.4ghz 4ch channel cctv dvr 2pcs wireless cameras audio night vision home security system ( 140.99 $)
Factory price 3 colors for choose OPal rhinestone brooches for wedding butterfly brooch for women fashion jewelry good gift ( 1.28 $)
Sexy women's halter asymmetrical flounced printed bikini set ( 10.31 $)
USB Charging Data Sync Cable Cord ( $2.35 )
20Pcs Makeup Brushes Set Pro Powder Blush Foundation Eyeshadow Eyeliner Lip Cosmetic Brush Kit Beauty Tools ( 4.97 $)
Nanum ii new 12v ii car steam humidifier with 2pc car charger usb,air purifier aroma oil diffuser aromatherapy mist maker fogger ( 17.20 $)
Loft industrial led pendant light for dinning room in nordic vintage lamp lamparas colgantes de techo ( 127.98 $)
Linen. Shop. | RASTL.RU
monster high home decals popular cartoon decorative pvc wall sticker for kids room 1416. mural art cartoon posters ( 5.99 $)
Casual elastic waist men's multi-pockets cargo shorts ( 18.09 $)
Coral fleece casual nap blanket with sleeve creative snowflakes pattern wearable warm and comfortable travel blankets ( 34.94 $)
Marylebone light navy blue peble tote ( 681.52 $) Aspinal of London
Discounts! top rated facial products
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).
READ MORE
Best Quality Brazilian Virgin Hair Loose Wave 4 Bundles 8A Unprocessed Virgin Human Hair Loose Wave Brazilian Hair Weave Bundles ( 38.50 $)
Sidebike professional bicycle cycling carbon fiber shoes lightweight s2-snap knob athletic shoes road bike self-locking shoes ( 119.34 $)
High Quality Universal 360 Rotate Cycling Bike Bicycle Handlebar Wide Angle Rearview Mirror Black Flexible Adjustable Safe ARE4 ( 3.09 $)
Mini brillant waterproof silicon bike bicycle cycling beetle warning light led front light rear tail lamp ( 0.99 $)
Purple wedding dress shoes high heel rhinestone bridal shoes 4 inch banquet party prom pumps elegant shoes for wedding ceremony ( 100.79 $)
Gradient brickcoral wool and cashmere fringed stole ( 44.93 $) Mila Schon
GY-135A Solder Sucker ( $1.85 )
Silk flower fake peony flower hot vivid 6 branches autumn artificial flowers wedding home party decoration ( 1.90 $)
Brazillian body wave with closure 8a grade rosa hair products 34 bundles wet and wavy brazilian human hair with closure ( 136.16 $)
Brazilian body wave hair weaves 4pcs virgin brazilian human hair bundles cheap natural black wonder beauty hair extensions ( 43.00 $)
Amkov AMK7000S 4K Ultra HD WiFi Action Camera-59.32 $
Brazilian Virgin Hair Loose Wave 4Bundles Brazilian Loose Wave 7A Unprocessed Brazilian Hair Weave Bundles 100% Human Hair Soft ( 53.34 $)
Bondage sex necklace sm toys punk style neck ring bdsm sex toys for women bondage necklace ( 3.25 $)
RFK Jr.: Trump "turning America into a petrol state…
Women Handbags Luxury Bag Fashion Bags Handbag Women Famous Brand New 2016 Bolsos Feminina Women Shoulder Bags SD-405 ( 54.88 $)
Discounts! best of beauty awards
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).
READ MORE
Chic colored ball shape pendant knitting design charm bracelet for women ( 4.14 $)
SJCAM M10 Plus Sports Camera DV-103.20 $
Black pop corn pouch ( 166.90 $) Kenzo
Black Quilted Leather Small Flap Crossbody Bag ( 175.00 $)
Kitchen Tomato Slicer ABS Plastic Cutter Slicer Kitchen Gadgets Lemon Orange Fruit Knife Cake Holder Cooking Tool Russian Style ( 2.10 $)
2016 Women Backpack Fashion Leather Shoulder Bags Colorful School Travel Bag for Teenager Girls Backpack Mochila Waterproof ( 23.99 $)
FINOW X5 3G Smartwatch Phone-140.85 $
For Apple iPad Pro 9.7 ( 8.99 $)
Mifree MIP4 1.54 inch Smartwatch Phone-27.58 $
Brazilian full lace human hair wigs with baby hair lace front human hair wigs glueless full lace human hair wigs for black woman ( 102.54 $)
Simple pu leather and colour block design women's sandals ( 33.27 $)
Brutalnij glubokij nokaut v sumo (Video)
1211CM FUNNY SEXY WITCH LADY GIR Sexy Witch Lady Car Stickers Car Sticker Decals BlackSilver CT-585 ( 1.39 $)
Chic rhinestone magnetic bracelet for women ( 3.08 $)
Burnt Orange Leather Nastro Trainers ( 175.00 $)
Discounts! the best new products
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).
READ MORE
5.5 inch blackview e7s smartphone mt6580 quad core 2gb 16gb 1280x720 mobile phone android 6.0 fingerprint 8.0mp unlocked phone ( 69.99 $)
Marrant crazy horse genuine leather bag casual men handbags men crossbody bags men s travel bag ( 98.00 $)
Black leather ankle boot ( 550.99 $) Emilio Pucci
New 7 inch monitor wireless cctv kit 2.4ghz 4ch channel cctv dvr 2pcs wireless cameras audio night vision home security system ( 140.99 $)
Factory price 3 colors for choose OPal rhinestone brooches for wedding butterfly brooch for women fashion jewelry good gift ( 1.28 $)
Sexy women's halter asymmetrical flounced printed bikini set ( 10.31 $)
USB Charging Data Sync Cable Cord ( $2.35 )
20Pcs Makeup Brushes Set Pro Powder Blush Foundation Eyeshadow Eyeliner Lip Cosmetic Brush Kit Beauty Tools ( 4.97 $)
Nanum ii new 12v ii car steam humidifier with 2pc car charger usb,air purifier aroma oil diffuser aromatherapy mist maker fogger ( 17.20 $)
Loft industrial led pendant light for dinning room in nordic vintage lamp lamparas colgantes de techo ( 127.98 $)
Linen. Shop. | RASTL.RU
monster high home decals popular cartoon decorative pvc wall sticker for kids room 1416. mural art cartoon posters ( 5.99 $)
Casual elastic waist men's multi-pockets cargo shorts ( 18.09 $)
Coral fleece casual nap blanket with sleeve creative snowflakes pattern wearable warm and comfortable travel blankets ( 34.94 $)
Marylebone light navy blue peble tote ( 681.52 $) Aspinal of London
Discounts! top rated facial products
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).
READ MORE
Best Quality Brazilian Virgin Hair Loose Wave 4 Bundles 8A Unprocessed Virgin Human Hair Loose Wave Brazilian Hair Weave Bundles ( 38.50 $)
Sidebike professional bicycle cycling carbon fiber shoes lightweight s2-snap knob athletic shoes road bike self-locking shoes ( 119.34 $)
High Quality Universal 360 Rotate Cycling Bike Bicycle Handlebar Wide Angle Rearview Mirror Black Flexible Adjustable Safe ARE4 ( 3.09 $)
Mini brillant waterproof silicon bike bicycle cycling beetle warning light led front light rear tail lamp ( 0.99 $)
Purple wedding dress shoes high heel rhinestone bridal shoes 4 inch banquet party prom pumps elegant shoes for wedding ceremony ( 100.79 $)
Gradient brickcoral wool and cashmere fringed stole ( 44.93 $) Mila Schon
GY-135A Solder Sucker ( $1.85 )
Silk flower fake peony flower hot vivid 6 branches autumn artificial flowers wedding home party decoration ( 1.90 $)
Brazillian body wave with closure 8a grade rosa hair products 34 bundles wet and wavy brazilian human hair with closure ( 136.16 $)
Brazilian body wave hair weaves 4pcs virgin brazilian human hair bundles cheap natural black wonder beauty hair extensions ( 43.00 $)
Amkov AMK7000S 4K Ultra HD WiFi Action Camera-59.32 $
Brazilian Virgin Hair Loose Wave 4Bundles Brazilian Loose Wave 7A Unprocessed Brazilian Hair Weave Bundles 100% Human Hair Soft ( 53.34 $)
Bondage sex necklace sm toys punk style neck ring bdsm sex toys for women bondage necklace ( 3.25 $)
RFK Jr.: Trump "turning America into a petrol state…
Women Handbags Luxury Bag Fashion Bags Handbag Women Famous Brand New 2016 Bolsos Feminina Women Shoulder Bags SD-405 ( 54.88 $)
#10
Posted 25/10/2017, 16:44
Hiv And Cephalexin 500 Mg levitra shipped from us Accutane Tablets Buy
Buy Diflucan Cheap Propecia Galenico viagra Brand Pfizer Viagra Online Online Ed Tratments Primatene Mist Canada
Cialis Somministrazione Viagra 25 Anos viagra Indoacin
Cialis 10 Mg Tomar Trikatu online pharmacy Canadian Pharmacy Propecia 20mg
Propecia Altere Manner Dosage Baclofene Alcool Levitra Prix En Bretagne viagra Buy Furosemide Cheapest Canadian Pharmacy Brought By Echeck
Viahra Propecia Ingredients Viagra Anziani levitra wholesale no prescription Keflex Antibiotic Structural Formula
Buy Diflucan Cheap Propecia Galenico viagra Brand Pfizer Viagra Online Online Ed Tratments Primatene Mist Canada
Cialis Somministrazione Viagra 25 Anos viagra Indoacin
Cialis 10 Mg Tomar Trikatu online pharmacy Canadian Pharmacy Propecia 20mg
Propecia Altere Manner Dosage Baclofene Alcool Levitra Prix En Bretagne viagra Buy Furosemide Cheapest Canadian Pharmacy Brought By Echeck
Viahra Propecia Ingredients Viagra Anziani levitra wholesale no prescription Keflex Antibiotic Structural Formula
#11
Posted 25/10/2017, 18:24
Preis Levitra 10 Mg 12 Stuck Amoxicillin Canine Pharmaceutical viagra Propecia Decadencia De Pelo Cytotec Sale Zithromax Second Dose
Amoxicillin 500 Mg Capsule Udl Effects order levitra at walmart Amoxicillin 500 Mg Generic
Achat Tadalis Sx 40 Mg Cialis Vente Tunisie Genuine Cialis Brand From Europe cheap levitra Acheter Cialis Bretagne
Keflex Vs Amoxicillin Cialis Tolerancia Cialis To Buy cheap cialis Viagra Levitra Kaufen Viagra Achat En France
Cialis Legal Ohne Rezept viagra Articulo 138 Purchase Synthroid Online No Prescription
How To Stay Erect Longer Resultados Propecia Efectos Secundarios Kamagra Oral Jelly viagra online pharmacy Butyr Fentanyl Buy Malegra Fxt Overnight Shipping
Amoxicillin 500 Mg Capsule Udl Effects order levitra at walmart Amoxicillin 500 Mg Generic
Achat Tadalis Sx 40 Mg Cialis Vente Tunisie Genuine Cialis Brand From Europe cheap levitra Acheter Cialis Bretagne
Keflex Vs Amoxicillin Cialis Tolerancia Cialis To Buy cheap cialis Viagra Levitra Kaufen Viagra Achat En France
Cialis Legal Ohne Rezept viagra Articulo 138 Purchase Synthroid Online No Prescription
How To Stay Erect Longer Resultados Propecia Efectos Secundarios Kamagra Oral Jelly viagra online pharmacy Butyr Fentanyl Buy Malegra Fxt Overnight Shipping
#12
Posted 25/10/2017, 20:56
Acheter Viagra Pharmacie Posologia Levitra Did Propecia Work For You general pharmacy levitra Priligy Vs Prozac
Viagra Homme Wikipedia viagra Provera Internet Medication. Discount Online Cod Only Provera Veraplex Visa Pharmacy. Cheap Free Shipping Provera Internet Website Cash On Delivery Propecia Tipos
Can Amoxicillin Cause Low Blood Pressure Propecia Pildora Td Bank viagra online Prix Du Kamagra Cialis Levitra Acquistare Cialis Online
On Line Sales Of Viagra viagra online prescription Amoxicillin Skin Treatment
Ist Levitra Rezeptpflichtig Bestellen Kopa Lasix order levitra at walmart Diarrhea Side Effect Of Cephalexin Does Keflex Make Your Heart Race
Levitra Side Effects viagra How Cau You Order Levitra On Line Propecia Minoxidil Pattern Baldness
Viagra Homme Wikipedia viagra Provera Internet Medication. Discount Online Cod Only Provera Veraplex Visa Pharmacy. Cheap Free Shipping Provera Internet Website Cash On Delivery Propecia Tipos
Can Amoxicillin Cause Low Blood Pressure Propecia Pildora Td Bank viagra online Prix Du Kamagra Cialis Levitra Acquistare Cialis Online
On Line Sales Of Viagra viagra online prescription Amoxicillin Skin Treatment
Ist Levitra Rezeptpflichtig Bestellen Kopa Lasix order levitra at walmart Diarrhea Side Effect Of Cephalexin Does Keflex Make Your Heart Race
Levitra Side Effects viagra How Cau You Order Levitra On Line Propecia Minoxidil Pattern Baldness
0 user(s) are reading this topic
0 membro(s), 0 visitante(s) e 0 membros anônimo(s)