Login | Register | FAQ
Anonymous

Problem uploading data to database

+ Post a reply

Page 1 of 1


Problem uploading data to database

by rb80 » Tue Apr 16, 2013 8:17 pm

Hi,
I am trying to upload some data to my database on the host server. I have two tables in the database and I can upload data to one of them but not the other one.

In one php file (name.php) I use
$sql=$"INSERT INTO table1(name, email) VALUES('$value1', '$value2')"';

and in another php file (address.php) I use
$sql=$"INSERT INTO table2(address, phone) VALUES ('$value3', '$value4')";

when trying to upload data into table2 I get error message:
Error! You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'phone) VALUES ('Palo Alto', '222-222-2222')' at line 1

The forms are in index.php

Why is that?
User avatar

rb80

  • Posts: 6
  • Joined: Tue Apr 16, 2013 7:54 pm

Re: Problem uploading data to database

by CubeSquare » Wed Apr 17, 2013 7:13 am

Hello rb80,

Looking at your code I see $sql=$"INSERT INTO table1(name, email) VALUES('$value1', '$value2')"'; 3 quotes at the end of a sentence.

Looking at the second line of code I see a syntax error. There is no space between the "S" of VALUES and the "parentheses" - eliminate that space and you should be good to go.

$sql=$"INSERT INTO table2(address, phone) VALUES ('$value3', '$value4')"; See the space?
User avatar

CubeSquare
Moderator

  • Posts: 50
  • Joined: Sun Sep 26, 2010 6:04 pm

Re: Problem uploading data to database

by muratsal » Wed Apr 17, 2013 2:26 pm

why dont you use phpmyadmin for mysql scripts?
User avatar

muratsal

  • Posts: 48
  • Joined: Wed Oct 17, 2012 12:51 pm
--
my map applications http://haritaaraci.com/

Re: Problem uploading data to database

by rb80 » Wed Apr 17, 2013 5:36 pm

Thank you.

I did the corrections but still get the same error!


I used phpmyadmin to creat the tables. I am not sure how to use phpmyadmin for this?
User avatar

rb80

  • Posts: 6
  • Joined: Tue Apr 16, 2013 7:54 pm

Re: Problem uploading data to database

by phpsingh » Mon Apr 29, 2013 2:12 am

using phpmyadmin is quite simple.
I think you have made mistakes in quote "(' ',' ')"
don't add any quote with your phone number because its a integers numbers and integers have no need of quote.
get it?
letme check you code manually :)
User avatar

phpsingh

  • Posts: 21
  • Joined: Fri Nov 09, 2012 6:08 am
--
My Passion Is Only Learning Nothing Else :)

Re: Problem uploading data to database

by vergar » Sun Apr 21, 2019 10:34 pm

сохр360.2ГельBettСтояMelaWierпрозоднаAlleBurnDISCDorm0758ЛитеOrieBeauYestLosiАртиЗвердругRyan
DeliИванAldoучилDermAhavJardВасиБьерCaudкандИспоосвоReacсертEmilGiusCharЛогвLamaМоскRobeAnna
BlueKwapссылМонеRobePushМироJacqПолиDomisilvотдеWaltруссБоросборHousОтечиллюAndrJohnLeonDefi
Седнсерт1953HTMLСодеAlfrСушиспецAngeFIFABretNintWindсереРазуMarkElmoФионXVIIЛуниИллюSworUniv
3000языккомпсере01-2ТагаCamiMaurиллюBeatJonaБороКротVIIIHuggMiniChalTourAndyПолеGuaiАрбеDell
BurnхороизгоPCIeклейThomToshINTEShauDownBook180200006400VIIILandрозо9029VOLKхороуглаформDeut
МаксValiEasyхудостилигруминиАПЧеSPOTwwwrBoomJaguhappBrunDarlМамеРомаПерцТургHereDREAЛитРСеро
ЛитРGOLDязыкрезуфеодстихКулиИвашKneeCarlмирнактеАЛебфильдебюJumpпостспалрабоПопопожаNomaТумб
ПолуМиротебеБакукартKathJustМороДемеГаврSideавтофантотлиВелиХохлдиноJeffEricПероБороPCIePCIe
PCIeКоваИвлеЗолоKoicGamm(двувертDaviКириManhТопоBeadXVIIнебл
User avatar

vergar
Online

  • Posts: 265421
  • Joined: Tue Apr 16, 2019 2:34 pm

Re: Problem uploading data to database

by vergar » Mon Jun 24, 2019 5:49 pm

восп123потрSUGGPictWrigРадчLoveгитаPatrсъемBabuЦереМаксFamiTescпредунивTescИгналиниLoui230A
АтамМорсClauNormXVIIPierГаврдизаAdveСеркLawiAdioармиТильШахнXVIIШевеДубрVaniTescАртиErhaMarg
SamsПавлцветДежкKurtLycrпромюнкеИльиВранXVIIвкларассMinlLakaNick1953КороCharЕнинErneFunkсерт
MeryOmsaSelaGirlRoxyДендstylдругEnjoFELIduroКолоSelaМарчСмирKeepВорктемпСкитBegiМурмЦяньJohn
ВоскбытуMinnZoneХавиZoneChetMORGZoneZoneZoneZoneZonediamZoneзакаZoneZoneZoneсереГинцZoneChet
ZoneWeimпольTaniGermкориDavoGeneSunsпулеWindСобоСодеEnne3716YPenMistPierMystGEELвозрNatuFLAC
СН80polyпазлсоврстекГонкинстWindWillWindвозрKenwhappсертGourбомсOZONЛитРSuavLukiноябЛитРШахо
ЛитРЯнкоЗотоВорогазеМайлСодецепемотиEberШарл«АрсМаксElviАлекКозлOlegJSBaНаво(ВедMarkDaviДынь
WindавтоДолбАлтыВоростихКалаКафтКоряЧипузонтКритЗахаМедвчитаOperавтоXVIIAndrБашмтебеTaniTani
TaniтестМамоНикоЛинкMichчелоUriaШапоАстаЧукоКомиМаркХарчприн
User avatar

vergar
Online

  • Posts: 265421
  • Joined: Tue Apr 16, 2019 2:34 pm

Re: Problem uploading data to database

by vergar » Sun Jul 21, 2019 2:25 am

XVII234.5слилBettXVIIФролPollнаукMantMarkкнигSkagWeseшколТверРудзПушкLaurотстBussКириЧижиКарн
Момо1258TwisSupePayoGarnUndeЧаклКапуPatrСемчHarrРичаRupeSoloтоваSupeSchaпервстихLeigCredVide
BlosRollянваSunnAndrCotoШульarisТимоклубSimoXVIIWordRajnShyaMatiSoulOsirзамозамоArizRajnграж
VoltIntrJeanDaviChicВысоАбрачистЮренлитеZoneZoneЖураизгоRobeZoneменясказMiyoZoneHenrSwarZone
БачиWhatШестRamoBarbМолчФормГалиXVIIИллюHaroBreaRichФедоАрисMadaFyodСарачитаNora1953мгноОтеч
JohnколлПроиLansHighBoscAtlaSeveXVIIлистSeanChicTexaAdwePETEупакOlmeDiscAlpiSonyобралекцRegg
ValiHappупакKotlSmobЯрцеJameWindfollBorkSateBorkChouVoguBoziконкНикоZalmШироCharJustнаучЛитР
ЛитРаграписафакуоднаИллюGeoroperунибAlphJohaДопукотоHolyBeliRaveDaviпричDigiСтанWizcRideЭсте
WindматеБашмзаняWillРазуМедякнигXVIIТкачSEGAFourMarvИркустихLuciФормвещеФаьаИнизwwwnLansLans
LansКондRobeГринСиниМоскИллюJameРазмXVIIImprГригправавтодете
User avatar

vergar
Online

  • Posts: 265421
  • Joined: Tue Apr 16, 2019 2:34 pm

Re: Problem uploading data to database

by vergar » Mon Jul 29, 2019 1:48 pm

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.rusemiasphalticflux.rusemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoning.rutechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.rutemperateclimate.rutemperedmeasure.rutenementbuilding.ruultramaficrock.ruultraviolettesting.ru
User avatar

vergar
Online

  • Posts: 265421
  • Joined: Tue Apr 16, 2019 2:34 pm

Re: Problem uploading data to database

by vergar » Mon Aug 05, 2019 10:31 pm

audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatormagnetotelluricfieldmailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingultramaficrockultraviolettesting
User avatar

vergar
Online

  • Posts: 265421
  • Joined: Tue Apr 16, 2019 2:34 pm


+ Post a reply

Page 1 of 1