473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

reading a blob...

Hi, i currently have a mysql database which stores a struct inside a blob
the structure is:
Expand|Select|Wrap|Line Numbers
  1. typedef struct NO_ALIGN st_minichar {
  2.     unsigned short packetSize; // 0x00 - 0x01
  3.     unsigned short command; // 0x02 - 0x03
  4.     unsigned char flags[4]; // 0x04 - 0x07
  5.     unsigned char unknown[8]; // 0x08 - 0x0F
  6.     unsigned short level; // 0x10 - 0x11
  7.     unsigned short reserved; // 0x12 - 0x13
  8.     char gcString[10]; // 0x14 - 0x1D
  9.     unsigned char unknown2[14]; // 0x1E - 0x2B
  10.     unsigned char nameColorBlue; // 0x2C
  11.     unsigned char nameColorGreen; // 0x2D
  12.     unsigned char nameColorRed; // 0x2E
  13.     unsigned char nameColorTransparency; // 0x2F
  14.     unsigned short skinID; // 0x30 - 0x31
  15.     unsigned char unknown3[18]; // 0x32 - 0x43
  16.     unsigned char sectionID; // 0x44
  17.     unsigned char _class; // 0x45
  18.     unsigned char skinFlag; // 0x46
  19.     unsigned char unknown4[5]; // 0x47 - 0x4B (same as unknown5 in E7)
  20.     unsigned short costume; // 0x4C - 0x4D
  21.     unsigned short skin; // 0x4E - 0x4F
  22.     unsigned short face; // 0x50 - 0x51
  23.     unsigned short head; // 0x52 - 0x53
  24.     unsigned short hair; // 0x54 - 0x55
  25.     unsigned short hairColorRed; // 0x56 - 0x57
  26.     unsigned short hairColorBlue; // 0x58 - 0x59
  27.     unsigned short hairColorGreen; // 0x5A - 0x5B
  28.     unsigned proportionX; // 0x5C - 0x5F
  29.     unsigned proportionY; // 0x60 - 0x63
  30.     unsigned char name[24]; // 0x64 - 0x7B
  31.     unsigned char unknown5[8] ; // 0x7C - 0x83
  32.     unsigned playTime;
  33. } MINICHAR;
  34.  
i want to be able to put it back into this format or at least read it so i can just get things out such as "name", "level", "_class" and "playTime"

Can anyone help?
May 12 '10 #1

✓ answered by Markus

How about fread()?

2 1198
Markus
6,050 Expert 4TB
How about fread()?
May 12 '10 #2
i should have mentioned im quite new to php...
how does fread work?
im sure i could work it out from there then =]
May 12 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: John | last post by:
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and...
3
by: Johan Vervoort | last post by:
How can I read a binary value from a blob via ODBC (Microsoft VFP driver-win32all)? The value seems to be truncated at the first '\0' TIA
6
by: Juergen Gerner | last post by:
Hello Python fans, I'm trying and searching for many days for an acceptable solution... without success. I want to store files in a database using BLOB fields. The database table has an ID field...
11
by: CSN | last post by:
Is it possible to iterate over an array in plpgsql? Something like: function insert_stuff (rel_ids int) .... foreach rel_ids as id insert into table (rel_id, val) values (id, 5);
1
by: Roberto Castro | last post by:
I have some problems with the way I am showing the BLOB fields in the Image web controls. It does work on my localhost though sometimes I need to hit Refresh for the images to load properly....
0
by: Paul Kennedy | last post by:
I have a situation where I am utilizing code from MSDN to insert XLS files into a Microsoft Access Table in a column of Ole Object using VBA and DAO. That code also provides me with a method to...
1
by: Ken | last post by:
Hello, I'm trying to read a Blob from Oracle and then write it to an audio file(.AU). I'm using Visual Studio.Net 2003 (VB). I can't seem to get my code to work. Will someone take a look at it...
2
by: pmz | last post by:
Dear Group, I'm connecting in C# with remote (BSD) MySQL server with ODBC Driver, and I'm trying to find the best sollution in such problem: As I've read on MySQL manual, they have suggested...
5
by: ajitp | last post by:
Hi, I am having serious trouble retreiving a blob from a oracle table. The pictures are stored in the database and I need to retreive the pictures and display it on a page. Can anyone help me...
1
by: Neerajpant | last post by:
Hi, I am facing problem while reading blob field from paradox database by using ADO. If anybody knows how to read blob fields from Paradox database by using MS Technologies, then please let me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.