473,480 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Search, grab & append the rows

damir
14 New Member
I don't know how to create the fastest query for the next situation:

The goal is to search the database of users by their settings column, append a notification column and grab an email from an email column depending on the settings column. Problem is that the settings column is consisted of 10 hexadecimal chars (which means that one char is four 0 or 1 settings, which is total of 40 binary settings).

This is the lite example of the database:
Expand|Select|Wrap|Line Numbers
  1. id |  settings  |      email     | notify
  2.  0 | 82b3ff4ab4 | test@email.com | link,
  3.  1 | 61baf32d7c | info@email.com | null
I worked with mysqli prepared statements, so I don't know if it's the brightest idea to make a loop in php (which I'm using) and for every user check its settings and determine whether to grab an email or not and whether to append the notify column with the additional update query or not.

I've also had in mind to use SELECT in combination with WHERE and LIKE with wildcards and with the update query to append the notify column, but the problem is in the settings column.

Does anyone have ideas what's the best way to do that?

My hosting service block my page because too many queries caused the processor overloading, so I'm a bit scared of these things right now.
Mar 21 '11 #1
3 1588
Rabbit
12,516 Recognized Expert Moderator MVP
You haven't specified which setting requires an email. But I suspect that boolean operators will accomplish what you need.
Mar 21 '11 #2
damir
14 New Member
How I concept it... If someone sends a new message, all users have to be checked, and based on settings of every user to determine whether to grab an email (and send an email to user later) and append the notify column to that user.

So if e.g. new message setting is the 3rd char, then that char has to be converted to bin to check bin values of the email and notify settings.

entire settings column:
82b3ff4ab4

b converted from hex to bin is 1 0 1 1

1st bin value (1) is the email setting, and the 2nd one is the notify setting (0).

If it's 1 then send/append, or do nothing if it's 0.
Mar 21 '11 #3
Rabbit
12,516 Recognized Expert Moderator MVP
If you substring out the third character, convert it to a number, and then bitwise-and 8, that will tell you if the e-mail setting is a 1 or 0. Or you could substring out the third character, convert it to binary, and substring the first character of that.
Mar 21 '11 #4

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

Similar topics

6
9357
by: Fan Ruo Xin | last post by:
I try to copy a table from production system (DB2 UDB EEE V7.2 + fixpak5) to the testing system (DB2 UDB V8.1 + fixpak4a). I moved the data from productions system by using the following steps:...
1
3051
by: PMB | last post by:
Thank you in advance for any and all assistance. I'm trying to use a make table query to pull the last transactionID, so I can use an append query to reset the transactionID to the next...
2
6522
by: Paul Wagstaff | last post by:
Hi there I have 2 tables: tblAccuracy & tblClearance Users add new records to tblAccuracy using frmRegister. Under specific conditions I need to append the current record from frmRegister into...
3
1170
by: Vjay77 | last post by:
I have pretty troubeling problem. I'd like to create an app which would submit a search to google.com and then I need to click on one of the results. I need to click on one which matches the...
3
1220
by: Woody Splawn | last post by:
For reasons I have not yet identified my Help, Search and Help, Index has quit working. That is, in the VB IDE, from the Help menu, I can select Dynamic help or Contents and things work as...
2
1072
by: Steve | last post by:
Anyway to limit the number of rows that will be shown on a datagrid? Thanks.
1
2974
by: SC | last post by:
I'm developing a site that may eventually have a very large database of users (hopefully, but who knows). It will be a community website where users can search each other (think Friendster,...
5
2379
by: justobservant | last post by:
When more than one keyword is typed into a search-query, most of the search-results displayed indicate specified keywords scattered throughout an entire website of content i.e., this is shown as...
0
1407
by: Oystein | last post by:
Hi! I've got a aspx page with a textbox, a detailsview and a gridview. In the textbox i enter a jobnumber. If the jobnumber exists in the table, the detailsview shows the columns in the table in...
1
1298
by: jmalcolm | last post by:
Hey guys! I have a problem. I am currently working on a project where I am required to look through a couple Databases (originally from Foxpro). One is a full contract list (roughly 2100 rows),...
0
6908
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
7045
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
6944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5341
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
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.