Jump to content

Search the Community

Showing results for tags 'transaction'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General Section
    • Announcements & News
    • Introduce Yourself
    • General Discussion
    • Recreational Activities
    • Entertainment
    • Private VIP Lounge
    • Art / Screenshot / PhotoGallery / Signature
    • Suggestion
  • Gaming - Discussion
    • Enemy Territory
    • Call of Duty Series
    • Insurgency Series
    • Day Of Infamy
    • Team Fortress
    • Battlefield Series
    • Counter Strike Series
    • Other Games
    • Console & Mobile Gaming
    • Complaints
  • Help & Discussion Center
    • Tutorials
    • Q&A / Reports / Issues
    • Downloads
    • Software & PC Support
    • Hardware Hangout
    • Reviews by Members for Members
    • Language Learning & Translation
  • Join =F|A= Community
    • Applications / Join Us
  • ETPRO's Topics
  • ET Trick Jump's Topics
  • Clash of Royal's Topics
  • Clash of Clans's Topics
  • Rocket League's Topics
  • Cards Against Humanity's Topics
  • Trading's Topics
  • ET Mapping's Topics
  • Rust's Topics
  • Runescape's Topics
  • GTA's Topics
  • Among Us's Topics
  • SCUM's Topics

Calendars

  • Community Calendar
  • Gaming Events
  • ETPRO's Events
  • ET Trick Jump's Events
  • Trading's Events

Product Groups

  • Donation Packages
  • VIP Membership
  • Private Slot
  • ETPRO Events
  • Advertising

Blogs

  • Death's blog
  • Excerpts from a Diary
  • A lil piece of my life
  • Dissertation writing
  • Loki's Blog
  • ThuMpeRKA's Blog
  • RoadKILL's Blog
  • CaldasGSM's Blog
  • Sponkala's Blog
  • $kullcollector's Blog
  • Ganja.'s Blog
  • $kullcollector's Blog
  • Chameleon's Blog
  • The ramblings of an internet addict
  • Narug0's Blog
  • Pantha´s life
  • BambooBlog
  • PHANTASM RANTS
  • LeftWingVixen's Blog
  • LeKs!!'s Blog
  • Ol' Smoke's Blog
  • Crips+'s Blog
  • Pvt. Parts' Blog
  • LEKS...HUNTER OF KILLERS Blog
  • StgsL's Blog
  • WET map tutorials
  • My journey in gaming world
  • Tech Blogs
  • FireWienie's Blog
  • leks... se la rifa's Blog
  • Skylark159's Blog
  • Gaming Simplified
  • Be Act!vity's Blog
  • *
  • Be Act!vity's Blog
  • willo's Blog
  • Be Act!vity's Blog
  • Picior's Blog
  • The Scribbles of a Madman
  • crazy mafia fox's Blog
  • Chameleon's Blog
  • crazy mafia fox's Blog
  • Freedom by Exact.
  • 1984's Blog
  • ESPCatalina's Blog
  • Radoria's Blog
  • leks... se la rifa's Blog
  • Deepak Jain's Blog
  • Aphrodite01's Blog
  • Going to California for 3 week training
  • GraveDigger's Blog
  • LordTerror's Blog
  • asassin's Blog
  • 3 Week California Army Reserve training
  • Braveheart's Blog
  • Matt123Mann's Blog
  • Braveheart's Blog
  • blackknight8653's Blog
  • N!tmod Official Blog!
  • Flashing Lights' Blog
  • Nitrox*'s Blog
  • Skillz's Blog
  • BigRich's Blog
  • Skillz's Blog
  • Madgemade's Blog
  • Bowly's Foods
  • Ricardo Puente's Blog
  • kimbohunter007's Blog
  • hisoka's Blog
  • Duckie's Blog
  • FlA Sneaky Guy's Blog
  • FlA Sneaky Guy's Blog
  • severjack's Blog
  • FlA Sneaky Guy's Blog
  • Yep
  • Leichensammler's Blog
  • clxph4l4nxX3ta's Blog
  • I Can Do This Crap Too!
  • The thoughts of an insane white boy
  • Bowly's Thoughts
  • JohnWitman's Blog
  • Medic's Blog
  • AcidParadox's Blog
  • AcidParadox's Blog
  • Devil's Blog
  • Thoughts of an Assassin
  • ladosisletal's Blog
  • ladosisletal's Blog
  • Chameleon's Blog
  • Jonne Mikkola's Blog
  • Hecken's Corner
  • Blog
  • =pb=theblackkill's Blog
  • J35T3R's Blog
  • Recktilectrik's Blog
  • Soup's Blog
  • rolan001 blog
  • Stavros' Blog
  • Marine's Blog
  • The Smoke's Blog
  • The Dramatic Life of a Typical Asian
  • A day in the life of DeCareaux
  • ZIGZAG's Blog
  • Pabbatt Blue's Blog
  • ZIGZAG's Blog
  • Neuro's Blog
  • turkoxp's Blog
  • Verillaxus' Blog
  • Novice's Blog
  • lucianalorrane's Blog
  • BF2 Sandbox
  • Platform
  • zippye87's Blog
  • Success & Failure
  • zippye87's Blog
  • KonSiX-!7's Blog
  • EdbMails for exchange Recovery
  • TheProOne's Blog
  • TheProOne's Blog
  • Interview: CheepHeep
  • cereal killer's Blog
  • Diary of a Radioman
  • JohnnyColorado
  • Jasons Days
  • The Life of a Sound&Lighttechnician
  • kimbohunter007's Blog
  • Memoir of eurotrip
  • OMGITSSHMANESBLOG
  • /dev/random
  • sawwasLT's Blog
  • Mapping Sandbox
  • Shagger's Blog
  • Joining a Clan
  • Shagger's Blog
  • The world's a mean mistress at times
  • Karine's Blog
  • War2022
  • weAsels diary
  • Ways to Secure Your Finances During High Inflation
  • The !Chuck4Abuck's small world Blog
  • Clash of Clans Bases
  • Christoffer's Blog
  • Upgrade Your Rest: Keetsa Discount Codes Revealed
  • eagle7wolfensteiner77's Blog
  • 時尚鞋服
  • eagle7wolfensteiner77's Blog
  • SendBig
  • eagle7wolfensteiner77's Blog
  • ZeroGPT
  • eagle7wolfensteiner77's Blog
  • ZeroGPT
  • Fb!N!nJa's Blog
  • ZeroGPT
  • Fb!N!nJa's Blog
  • ZeroGPT
  • 1984's Blog
  • Lyon 2023 Festival of Lights
  • viper1's Blog
  • Upgrade Your Lifestyle for Less Dabbsson Discount Code Unveiled
  • viper1's Blog
  • Flatbed Tow Truck Services Your Reliable Roadside Partner
  • caca_de_puercp's Blog
  • UnrealPerson
  • czarek_pl's Blog
  • SendBig
  • MoAZeR's Blog
  • zerogpt
  • Seppe*'s Blog
  • ZeroGPT
  • chips1chips1's Blog
  • ZeroGPT
  • St0nedGh0st's Blog
  • ZeroGPT
  • Jaaa!&'s Blog
  • ZeroGPT
  • test
  • ZeroGPT
  • admin's Blog
  • Life The Universe And Everything
  • Years to Cheers: Ideas for Humorous Birthday Cards for All Ages
  • CSL's Blog
  • Papa recoil's blogy
  • Strato!'s Blog
  • o
  • ET: from zero to hero
  • JayC's Blog
  • Dupstep's Blog
  • GodLui's Blog
  • M4A1+CQB's Blog
  • Chuckun's F|A Experience
  • M4A1+CQB's Blog
  • Diary Of A Wicked
  • ETNam.OrG
  • Computers are Strange
  • angel96's Blog
  • ToXiiCxKKiNg's Blog
  • Zuthus' Blog
  • janno's Blog
  • DJ´s free Software Blog
  • Excellent !!!!
  • Scream's thoughts
  • wesker's Blog
  • Bla Bla Bla
  • mattle's Blog
  • Panzerknacker's Blog
  • OMFG_A_BUNNY's Blog
  • Leaving
  • Fargwire's Blog
  • Fargwire's Blog
  • *SwissArmy*'s Blog
  • monkeysmack's Blog
  • MiNiOn's Blog
  • MiNiOn's Blog
  • Wizbang's Blog
  • Blawg
  • yoyotach's Blog
  • Vendela's Blog
  • King Hexaan's Blog
  • Gotcha
  • DJ´s Hardware Corner
  • azn_wan92's Blog
  • =Death Hunter='s It's those little things...
  • Panzerknacker's Blog
  • Big-E!:)'s Blog
  • SanToS' Blog
  • Pinoy Blog
  • Qlimax's Blog
  • DJ's Rumor Mill
  • tyler's Blog
  • WaaSab:>
  • Colin's Movie Blog
  • Weld21dejo's Blog
  • GI-JOE's Blog
  • Crasher's Blog
  • Ramblings
  • Blade
  • Blade's Blog of Mishaps and Misfortune
  • Panzer-WT?'s Blog
  • Fierce's Toolshop
  • Caulktails and Video Games
  • Caulktails and Video Games
  • YoYoO SonnY's Blog
  • YoYoO SonnY's Blog
  • wuolfe
  • Warning.'s Blog
  • Reviews
  • The Archangel Chronicles
  • Me sports and gaming
  • Yellow Flash's Epic journey
  • H3LLB0Y's Blog
  • How to be a good player at shooting games
  • member for a few days
  • bubading_CZE's Blog
  • Ooops' Blog
  • sssssss
  • Common Sense
  • hUnI's Blog
  • Adroits LAN - Enemy Territory Overview
  • ybmad's Blog
  • mR.d0t's Blog
  • Dennis' Mapping Project and More
  • Boring Monday
  • Battle of the Wits
  • NoCell's Noob explanation blog.
  • Perceivisms
  • Jormehara
  • Alien 01
  • =Death Hunter='s Constitutional Rants
  • Ph0eniX's Blog
  • Phr33 St00f Pl0x
  • Heretic121's Blog
  • B1gM1k3's Blog
  • Rap & HipHop Place
  • Small true story being Australia
  • jaie's Blog
  • redirect tf2 test
  • =FA=GuN's Blog
  • Meh
  • INDIAN**'s Blog
  • jungleo_0's Blog
  • dontkill me's Blog
  • Patrick's Blog
  • Jake P's Blog
  • Junior Tejera's Blog
  • Brain Chow
  • jwills112's Blog
  • halaluia
  • kamikaze's Blog
  • Why not?
  • Dare2BeFair / Captain.'s Blog
  • ronaldounit0's Blog 2/25
  • Journey of a troll to a man
  • Taborham Lincoln's Blog
  • The Adventures of Taborham Lincoln
  • -Shut Down2-
  • Xernicus' Coffee Blog
  • F3@R's Blog
  • Wolfenstein classic vs wolfenstein The New Order
  • Mr.Karizmatic's Blog
  • TrackBase
  • david812's Blog
  • Detorkville's Blog
  • -Shut Down-
  • Chameleon's Blog
  • Prime's Log Entries : The Return of Apha Trion
  • Ktom's Blog

Categories

  • Fearless Assassins Software
  • Enemy Territory
    • Software
    • Maps
    • Map Scripts
    • Mods
    • Soundpacks
    • Skinpacks
    • LUA
    • Player Configs
    • Waypoints
    • Punkbuster
  • Call of Duty 4
    • Software
    • Mods
    • Maps
    • Player Configs
  • Other Games
    • Insurgency
    • Minecraft
    • Team Fortress 2
    • Counter Strike Series
  • Windows Software
  • Sounds

Categories

There are no results to display.

There are no results to display.

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Youtube


Steam


Xbox Live


PSN ID


Discord


Battlelog


Website URL


Skype


Occupation


Battle.net


Alias


Admin


Interests


SL


TB


Location


Steam ID


steamID64


T-M


S1


HC


B2

Found 1 result

  1. Hello everyone, mySQL is driving me mad for several days yet. I thought twice, trice, googled, googled and googled as hell and would not ask if I wouldn't be f*kd up like now... The starting situation is that I wanted to write a little blog system with PHP and SQL. Software-Info: * Windows 8.1 Professional Edition * Apache/2.4.23 (Win32); OpenSSL/1.0.2h; PHP Version 7.0.9; PHP-Extension: mysqli * phpMyAdmin 4.5.1; 10.1.16-MariaDB; DB-Client Version: libmysql - mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $ To create an entry and connecting with the file system with a smooth handling I need two columns (id and order) that are "unique". In this system it's not possible to make two columns unique. So there must a way to make both columns unique "virtually". -------------------------------------------------------------------------------------- | id* | headline | word | unlocked | order* | timestamp | -------------------------------------------------------------------------------------- | 20180826235958 | Hello | How are you? | 0 | 1 | 2018-08-26 23:59:58 | | 20180826235959 | Hi | I'm fine | 0 | 2 | 2018-08-26 23:59:59 | id: int(255); datetime as only number - *must be unique as id headline: text word: text unlocked: tinyint(1); boolean to make in-/visible order: int(255); *must be unique, too; to reorder the entries without touching the id The main problem is to make the INSERT command proof for no double entries. In fact the id is not auto_increment but unique - it takes the datetime to be unique. This is important to the id-validation being 14 chars long. Anyway so you can do something like this: INSERT INTO `_myTable` (`id` ,`headline`,`word`, `unlocked`, `order`, `timestamp`) VALUES ('20180826235958' ,'','', 0, 1, '2018-08-26 23:59:58') But what is, when you *click*, *click*, *click* in one second? You can wait for returning false, when duplicate key(id) is fired and then re-ask again to: INSERT INTO `_myTable` (`id` ,`headline`,`word`, `unlocked`, `order`, `timestamp`) VALUES (LAST_INSERT_ID(id)+1 ,'','', 0, 1, '2018-08-26 23:59:58') This solution is a little ugly (because you can get an id like 20180826235960) but this seems be working. -------------------------------------------------------------------------------------------------------------------------------- The minor problem is to count up the `order` field. I tried sth: INSERT INTO `_myTable` (`id` ,`headline`,`word`, `unlocked`, `order`, `timestamp`) VALUES ('20180826' ,'','', 0, myorder, '2018-08-26 16:37:02') SELECT `id` AS tmpID, IFNULL(MAX(`order`), 0) + 1 AS myorder FROM `_myTable`; SELECT LAST_INSERT_ID(); Result: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT `id` AS tmpID, IFNULL(MAX(`order`), 0) + 1 AS myorder FROM `_myTable' at line 5 By researching I found some interesting things but nothing of this worked EVEN they have rated up posts: https://stackoverflow.com/questions/5360117/insert-and-set-value-with-max1-problems 1. -------------------------------------------------------------------------------------------------------------------------------- The best way is to use a transaction but if your not using innodb tables then next best is locking the tables and then performing your queries. So: Lock tables customers write; $max = SELECT MAX( customer_id ) FROM customers; Grab the max id and then perform the insert INSERT INTO customers( customer_id, firstname, surname ) VALUES ($max+1 , 'jim', 'sock') unlock tables; -------------------------------------------------------------------------------------------------------------------------------- This is this one most interesting but I don't know if i cant trust locking tables: 1. if I lock tables then writing PHP-Code to calculate some out then continuing but the request crashes - what's up with the locked table when it's not unlocked? 2. if the table is locked with "write" what will be if another request on the table appears being blocked? Would the other request wait until the lock is released OR will it cancel the request? 2. -------------------------------------------------------------------------------------------------------------------------------- INSERT INTO customers( customer_id, firstname, surname ) SELECT MAX( customer_id ) + 1, 'jim', 'sock' FROM customers; -------------------------------------------------------------------------------------------------------------------------------- This is the way i tryed out above and does not work. 3. -------------------------------------------------------------------------------------------------------------------------------- INSERT INTO customers ( customer_id, firstname, surname ) VALUES ((SELECT MAX( customer_id )+1 FROM customers cust), 'sharath', 'rock') -------------------------------------------------------------------------------------------------------------------------------- This one does not work anyway - see screenshot. Cannot imagine that post getting 9 points up without working on syntax. Either I do sth. wrong here or nobody tests the code before rating up. What do yu think is the best practice to write transaction proof table entries like this? my test-source: $multiSQL = " INSERT INTO `".secure_sql($tbl)."` (".$field_str.") VALUES (".$value_str.") SELECT MAX(`order`)+1 AS iORDER FROM `".secure_sql($tbl)."`; SELECT LAST_INSERT_ID(); "; $insert = mysqli_multi_query($token['connection'],$multiSQL); if($insert){ echo 1 . '<br />'; print_r(mysqli_fetch_assoc($insert)); }else{ echo $multiSQL; $multiSQL = " INSERT INTO `".secure_sql($tbl)."` (".$field_str.") VALUES (LAST_INSERT_ID(id)+1 , ".$value_strD.") SELECT MAX(`order`)+1 AS iORDER FROM `".secure_sql($tbl)."`; SELECT LAST_INSERT_ID(); "; $insert = mysqli_multi_query($token['connection'],$multiSQL); if($insert){ echo 2 . '<br />'; print_r(mysqli_fetch_assoc($insert)); }else{ echo $multiSQL; } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.