En cours

PHPMaker filter to limit user access to only certain data

I am basically looking to speak with someone familiar with PHPMaker "Server Event" functions:

function Recordset_Selecting(&$filter) {

ew_AddFilter($filter, "(Field1 = 1234)"); // Add your own filter expression

}

I have 2 tables. One has names and addresses and the other is a user table that has username, password, cities.

All I need to do is when the user logs in to filter access in the main table to only the cities that they are authorized for. This is probably 2 or 3 lines of code but beyond me. There are other functions I would like to add but I need to get by this hurdle first.

What I have that works in regular MYSQL is:

SELECT *

FROM MyMainTable

WHERE FIND_IN_SET(City, REPLACE('New York, Buffalo, Syracuse', ' ', '')) != 0;

The above will limit the cities to only those 3 out of dozens in the main table. I basically need the

function Recordset_Selecting(&$filter) {

ew_AddFilter($filter, "(Field1 = 1234)"); // Add your own filter expression

}

equivalent to only allow (CurrentUserName() to access a comma delimited list of cities in the "Users" table. This is probably 2 lines of code or so like above. I am just spinning my wheels too much on this. I really only need some coaching or to be able to call on a per minute thing or something. I don't have a huge budget but can pay paypal immediately.

I don't care if I have to manually add each comma delimited city in via phpmyadmin. Nothing needs to be that automated and fancy at this point.

If you are not familiar with PHPMaker then it would most likely take you too much time to get up to speed. This should literally be some conversation on the phone, emails etc. I could provide access to a sample database for you to experiment with.

My max is probably $50 on this so I don't want to waste your time. This should be pretty simple and I have some correspondence from PHPMaker support to explain more in depth what has to be done.

Thanks for looking!

Art

Hello,

I just wanted to update this as I had this working the other night, thought I saved to the "Code Repository" but I goofed. Now that I know more I think I can simplify the problem greatly to a single line that I need debugged.

In short this did end up being a single line of code as I suspected. A "Server Event" something like:


// Recordset Searching event
function Recordset_Searching(&$filter) {
// Enter your code here
ew_AddFilter($filter, "`MyMainTable`.`City` IN (" . CurrentUserInfo("Cities") . ")");
}

It may have been a "Record_Selecting" event but I forget.


The code itself being:

ew_AddFilter($filter, "`MyMainTable`.`City` IN (" . CurrentUserInfo("Cities") . ")");



Now I know much more than I did when posting this originally. I do know where server events are input and that security has to be "Advanced" for this to fire.


During debug I was getting the following errors:

Failed to execute SQL: SELECT * FROM `MyMainTable` WHERE `MyMainTable`.`City` IN () LIMIT 20 OFFSET 0. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LIMIT 20 OFFSET 0' at line 1

No records found


(mysqlt): SELECT COUNT(*) FROM `MyMainTable` WHERE `MyMainTable`.`City` IN ()
Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1


(mysqlt): SELECT * FROM `MyMainTable` WHERE `MyMainTable`.`City` IN ()
Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1


(mysqlt): SELECT * FROM `MyMainTable` WHERE `MyMainTable`.`City` IN () LIMIT 20 OFFSET 0
Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LIMIT 20 OFFSET 0' at line 1

It's obviously not finding "Cities". My cities are in a table called "Users" and single quote-comma delimited (ex: 'Buffalo', 'Syracuse', 'New York').


First person that can do it for $50 if I don't solve it first gets the gig. Sorry it's not a show stopper project but not bad for a few minutes of time to consult and one line of code. VB is just more my thing than MYSQL or PHP.


Let me know.

Thanks,


ARt

Compétences : PHP, Architecture Logicielle

Voir plus : phpmaker filter, filter phpmaker, phpmaker username, phpmaker filter user, phpmaker filter database user, add filter phpmaker, phpmaker table filter, users phpmaker, filter table phpmaker, phpmaker user access, phpmaker list filter, what is a regular expression, regular expression functions, regular expression function, regular expression code, paypal architecture, pay me to do something, mysql data access, list of paypal emails, first new york, depth first, filter works phpmaker, phpmaker access limit, find_in_set phpmaker, phpmaker filter table username

Concernant l'employeur :
( 1 commentaire ) Medford, United States

N° du projet : #1633484

Décerné à :

jbrad04

Please See my PM

50 $ USD en 5 jours
(2 Commentaires)
2.1

6 freelance ont fait une offre moyenne de 143 $ pour ce travail

acesolution

lets do this now

60 $ USD en 1 jour
(100 Commentaires)
6.5
daziabey

i would like to do this project for the above rate so if you are interested please let me know it. thank you.

200 $ USD en 8 jours
(2 Commentaires)
3.4
lalta1

Hi, Can i help you?.I can do this. Thanks

100 $ USD en 5 jours
(0 Commentaires)
0.0
Q6phM31UX

<b><i>Removed by Admin</i></b> - Custom software development - skpye: <b><i>Removed by Admin</i></b>

250 $ USD en 1 jour
(0 Commentaires)
0.0
infotechKendall

HELLO SIR PLEASE CHECK PMB

200 $ USD en 3 jours
(0 Commentaires)
0.0