Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,165,347 members, 7,860,897 topics. Date: Friday, 14 June 2024 at 06:18 PM |
Nairaland Forum / Science/Technology / Programming / Need Help With Insert (892 Views)
Problem With Insert Statement Mysql / Please Help On How To Insert Smiley In An Output Text In Java Script / Insert Image Into Mysql (2) (3) (4)
Need Help With Insert by ckdoublene: 9:22pm On Feb 04, 2011 |
I'm trying to acquire data from one table(payments) and insert it into another (prerenthist). Both tables are in the same database (prerentdb). I get error message: Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\hofiles\prerentadd.php on line 9the code is below. ? <?php |
Re: Need Help With Insert by segsalerty(m): 10:43pm On Feb 04, 2011 |
the keyword VALUES thats missing shld be causing problem |
Re: Need Help With Insert by Kobojunkie: 1:20am On Feb 05, 2011 |
Check the column types. Make sure you the type you are selecting matches the type you are inserting into. |
Re: Need Help With Insert by sweetpawn1: 10:31am On Feb 05, 2011 |
HELLO, WHATZ UP WITH THE LAST THING I ASKED YOU TO GIVE ME? LET'S LOOK AT THIS ONE:
THE ABOVE SYNTAX IS WRONG BECAUSE YOU SHOULD HAVE AN END OF QUOTE.LIKE THIS:
EVEN AT THAT, THERE ARE LOGICAL ERRORS! YOU WANT TO GET DATA FROM TABLE1 AND INSERT INTO TABLE2. THAT MEANS THAT YOU SHOULD GO THROUGH EACH ROW OF TABLE1, GET OUT ALL THE DATA FIELDS IN THAT RECORD, AND TRANSFER THE DATA FIELD RECORDS TO TABLE2 . I AM SPEAKING SPANISH - I KNOW. WILL BACK UP MY GIBBERISH WITH CODES SOON! |
Re: Need Help With Insert by sweetpawn1: 11:00am On Feb 05, 2011 |
HERE IT IS:
PLEASE, [size=18pt]RETURN FEED BACK!!!!!!!!!!!!![/size] |
Re: Need Help With Insert by ckdoublene: 9:09pm On Feb 05, 2011 |
Sorry, I should have cleared this earlier. This was the solution: <?php |
Re: Need Help With Insert by sweetpawn1: 2:32am On Feb 06, 2011 |
HMM, HOW DO YOU RUN THAT SCRIPT? DO YOU USE A FORM? WHERE DO YOU GET THE VALUES THAT ENTER INTO THE PRERENTHIST TABLE? I AM CURIOUS TO LEARN HOW YOU DID THAT! OR ARE YOU SHOWING A PIECE OF THE CODE? HOW DID YOU SOLVE YOUR LAST PROBLEM? OH AND FOR THE TRANSLATION OF WHAT I SAID LAST TIME WE MET. NO SLEEP LEAVE ME O! ---> DO NOT SLEEP OFF AND LEAVE ME HERE WAITING FOR YOU TO POST BACK MOSQUITOES DEY KILL ME FOR HERE! ---> WE HAVE THOSE VAMPIRE BLOOD SUCKING CREATURES EVERYWHERE IN OUR COUNTRY. THEY TAKE OVER FROM FILES AT NIGHT AND REALLY TORMENT US. SO THEY WERE BITING ME LIKE HELL! I DEY SOUND THEM SLAP AND DEM DEY DO ME ODEOSHI! ---> I AM ATTACKING THEM BACK WITH SLAPS BUT ITS LIKE THEY JUST TAKE MY BLOWS, DUST DIRT OFF THEIR SHOULDERS AND SAY: THAT AIN'T NOTHING! |
Re: Need Help With Insert by ckdoublene: 5:18am On Feb 06, 2011 |
Sweet, no there is no form. I just read one table(current month's payments), which I refresh each month (the unresolved program) and insert the data into the next table(a history of payments). Don't tell me mosquitos are getting to you while you're at the computer? Here in Florida we have trouble with mosquitos during the warm months but not in the cooler months. When I go hunting, if I'm near water , sometimes. Still haven't figured out how to add the "add 10 to latechg" in the other program. |
Re: Need Help With Insert by sweetpawn1: 5:03pm On Feb 06, 2011 |
HMM, INTERESTING! YES THERE ARE MOSQUETOES EVERY WHERE IN THIS COUNTRY! THEY ARE EVEN GETTING IMMUNE TO INSECTICIDES. SOME FOLKS EVEN SUGGEST THAT WE USE JUJU (BLACK MAGIC) TO TACKLE THEM! AS I TYPE I CAN HEAR ONE HUMMING REASSURINGLY FROM A DISTANCE AS IF TO TELL ME OF THE FEAST THAT THEY WILL HAVE OF ME THIS NIGHT! BUT STILL HOW DO YOU VIEW AND ENTER DATA INTO YOUR DATABASE? |
Re: Need Help With Insert by ckdoublene: 10:52pm On Feb 06, 2011 |
the WHERE statement dictates which data is updated. You are referring to the original program? |
Re: Need Help With Insert by sweetpawn1: 11:45pm On Feb 06, 2011 |
YES THE ORIGINAL, BUT YOU DON'T REALLY GET ME YET. OKAY , IMAGINE YOU WERE GOING TO THE BERMUDA TRIANGLE AND WERE SCARED YOU WOULD BE "LOST"! THEN YOU WOULD LOOK FOR SOME ONE TO TAKE OVER YOUR WORK OF "PUSHING THE BUTTONS TO SAVE THE WORLD" FOR YOU. SO LET US SAY, THAT SOME ONE IS MOI! SO HOW WOULD YOU TELL ME TO ADD THE DATA TO YOUR CURRENT RENT UPDATING SYSTEM? OF COURSE YOU WOULD GIVE ME A GUIDE AS TO HOW YOU DO WHAT YOU DO AND THE TOOLS(SOFTWARE) YOU USE. THAT'S WHAT I WANT TO KNOW! YOU ARE GIVING ME PART OF THE WHOLE PICTURE SO I CANNOT REALLY UNDERSTAND WHAT AND HOW YOU DO WHAT YOU DO! IF I HAD A GLIMPSE OF THE WHOLE, THEN I CAN SURLY KNOW HOW TO MAKE IT WORK BETTER! |
Re: Need Help With Insert by ckdoublene: 8:01am On Feb 07, 2011 |
Sweetheart, you speak my language so I don't understand the difficutlty explaining to you. The below code says that all records in the database table which having the paidsum = rentdue or any records that have L in the late field should have the specified values cleared (zeros or blanks). This is to start the new month with a report ready to register payments for the new month. The below code does that. I want to expand the program to add $10 to the latechg field of any tenants who haven't paid the full rent (paidsum < rentdue) and increase the prevbal by the amount of the rent still owed (prevbal = prevbal +( rentdue - paidsum) for those late payers. I have one glass of milk - with marshmalloows in it - and cookies. Every cookie I find in it, I want to remove. What am I saying, I'd rather have the cookies. This is the original problem with the original code. <?php |
(1) (Reply)
Social Network / [Resolved Issue] Sql Syntax Needed / Android Developers, A Newbie Needs A Good Recommendation
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 29 |