civerius Posted April 24, 2007 Share Posted April 24, 2007 Im looking for some quick help , just need a PhP command that gets a mysql row. but DOES NOT return it in an array. thanks (on MySQL db) Quote Link to comment https://forums.phpfreaks.com/topic/48380-solved-simple-php-command/ Share on other sites More sharing options...
trq Posted April 24, 2007 Share Posted April 24, 2007 mysql_fetch_object returns an object. How do you want this row formatted if not an array? Quote Link to comment https://forums.phpfreaks.com/topic/48380-solved-simple-php-command/#findComment-236543 Share on other sites More sharing options...
Glyde Posted April 24, 2007 Share Posted April 24, 2007 mysql_fetch_object(); may I ask why you can't use mysql_fetch_assoc() or mysql_fetch_array()? Quote Link to comment https://forums.phpfreaks.com/topic/48380-solved-simple-php-command/#findComment-236544 Share on other sites More sharing options...
civerius Posted April 24, 2007 Author Share Posted April 24, 2007 I wanted to retrieve a row ,So i can edit it directly from there Quote Link to comment https://forums.phpfreaks.com/topic/48380-solved-simple-php-command/#findComment-236547 Share on other sites More sharing options...
MadTechie Posted April 24, 2007 Share Posted April 24, 2007 directly !! your have to fetch and then update Quote Link to comment https://forums.phpfreaks.com/topic/48380-solved-simple-php-command/#findComment-236549 Share on other sites More sharing options...
trq Posted April 24, 2007 Share Posted April 24, 2007 I wanted to retrieve a row ,So i can edit it directly from there Sorry, but that makes little sense. Any edits you make will not effect the data in the database. Besides, you can edit the array values as you wish. Quote Link to comment https://forums.phpfreaks.com/topic/48380-solved-simple-php-command/#findComment-236550 Share on other sites More sharing options...
civerius Posted April 24, 2007 Author Share Posted April 24, 2007 Oh oh,wait let me re-phrase it.. To retrieve a WHOLE row,but NOT in an array. Im still learning so bear with me now . Quote Link to comment https://forums.phpfreaks.com/topic/48380-solved-simple-php-command/#findComment-236552 Share on other sites More sharing options...
MadTechie Posted April 24, 2007 Share Posted April 24, 2007 SELECT * FROM table will retrieve a WHOLE row, it will go into an array you can then pull out the parts you want (or all of them) then edit them and then use UPDATE table SET (field1, field2, field3 ) VALUE ('$field1', '$field2', '$field3'); you can't edit them like an ADO connection Quote Link to comment https://forums.phpfreaks.com/topic/48380-solved-simple-php-command/#findComment-236555 Share on other sites More sharing options...
trq Posted April 24, 2007 Share Posted April 24, 2007 Oh oh,wait let me re-phrase it.. To retrieve a WHOLE row,but NOT in an array. How do you want the row formatted if not in an array? No such function exists. The question still remains.... why? What exactly are you trying to do? Quote Link to comment https://forums.phpfreaks.com/topic/48380-solved-simple-php-command/#findComment-236557 Share on other sites More sharing options...
MadTechie Posted April 24, 2007 Share Posted April 24, 2007 could always create a function that extracts the data from the array, not sure how your return the data from the function the question we all want to know is WHY Quote Link to comment https://forums.phpfreaks.com/topic/48380-solved-simple-php-command/#findComment-236558 Share on other sites More sharing options...
civerius Posted April 24, 2007 Author Share Posted April 24, 2007 Emulation(Rpg), db contains server data so if i want to edit something i wanted it to be retrieved in a whole Row, Array ( [entry] => 37 [class] => 2 [subclass] => 0 [unk0] => 0 [name] => Worn Axe [name2] => Worn Axe [name3] => Worn Axe [name4] => Worn Axe [displayid] => 14029 [Quality] => 1 [Flags] => 0 [buyCount] => 1 [buyPrice] => 38 [sellPrice] => 7 [inventoryType] => 21 [AllowableClass] => -1 [AllowableRace] => -1 [itemLevel] => 2 [RequiredLevel] => 1 [RequiredSkill] => 0 [RequiredSkillRank] => 0 [requiredspell] => 0 [requiredhonorrank] => 0 [RequiredCityRank] => 0 [RequiredReputationFaction] => 0 [RequiredReputationRank] => 0 [maxcount] => 0 [stackable] => 1 [ContainerSlots] => 0 [stat_type1] => 0 [stat_value1] => 0 [stat_type2] => 0 [stat_value2] => 0 [stat_type3] => 0 [stat_value3] => 0 [stat_type4] => 0 [stat_value4] => 0 [stat_type5] => 0 [stat_value5] => 0 [stat_type6] => 0 [stat_value6] => 0 [stat_type7] => 0 [stat_value7] => 0 [stat_type8] => 0 [stat_value8] => 0 [stat_type9] => 0 [stat_value9] => 0 [stat_type10] => 0 [stat_value10] => 0 [dmg_min1] => 1 [dmg_max1] => 3 [dmg_type1] => 0 [dmg_min2] => 0 [dmg_max2] => 0 [dmg_type2] => 0 [dmg_min3] => 0 [dmg_max3] => 0 [dmg_type3] => 0 [dmg_min4] => 0 [dmg_max4] => 0 [dmg_type4] => 0 [dmg_min5] => 0 [dmg_max5] => 0 [dmg_type5] => 0 [armor] => 0 [holy_res] => 0 [fire_res] => 0 [nature_res] => 0 [frost_res] => 0 [shadow_res] => 0 [arcane_res] => 0 [delay] => 2000 [ammo_type] => 0 [RangedModRange] => 0 [spellid_1] => 0 [spelltrigger_1] => 0 [spellcharges_1] => 0 [spellcooldown_1] => 0 [spellcategory_1] => 0 [spellcategorycooldown_1] => 0 [spellid_2] => 0 [spelltrigger_2] => 0 [spellcharges_2] => 0 [spellcooldown_2] => 0 [spellcategory_2] => 0 [spellcategorycooldown_2] => 0 [spellid_3] => 0 [spelltrigger_3] => 0 [spellcharges_3] => 0 [spellcooldown_3] => 0 [spellcategory_3] => 0 [spellcategorycooldown_3] => 0 [spellid_4] => 0 [spelltrigger_4] => 0 [spellcharges_4] => 0 [spellcooldown_4] => 0 [spellcategory_4] => 0 [spellcategorycooldown_4] => 0 [spellid_5] => 0 [spelltrigger_5] => 0 [spellcharges_5] => 0 [spellcooldown_5] => 0 [spellcategory_5] => 0 [spellcategorycooldown_5] => 0 [bonding] => 0 [description] => [PageText] => 0 [LanguageID] => 0 [PageMaterial] => 0 [startquest] => 0 [lockid] => 0 [Material] => 1 [sheath] => 3 [Extra] => 0 [RandProp] => 0 [block] => 0 [itemset] => 0 [MaxDurability] => 20 [area] => 0 [map] => 0 [bagFamily] => 0 [totemCategory] => 0 [socketColor_1] => 0 [socketContent_1] => 0 [socketColor_2] => 0 [socketContent_2] => 0 [socketColor_3] => 0 [socketContent_3] => 0 [socketBonus] => 0 [gem_properties] => 0 [extendedItemCost] => 0 [disenchantSkillLevel] => 0 [scriptName] => internalitemhanler [DisenchantID] => 0 ) Quote Link to comment https://forums.phpfreaks.com/topic/48380-solved-simple-php-command/#findComment-236563 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.